def learnerTest( naTrain, naTest ):
    llRange = range(5,51,5)
    
    lfRes = []
    for lK in llRange:
        cLearn = ftu.createKnnLearner( naTrain, lKnn=lK, leafsize=100 )
        fError = 0.0

        naResult = cLearn.query( naTest[:,:-1] )
        naError = abs( naResult - naTest[:,-1] )
        lfRes.append( np.average(naError) )
    
    ''' Generate error of 'dumb' case, just assume average returns every time '''
    naGuess = np.ones( naTest.shape[0] ) * np.average( naTrain[:,-1] )
    lfGuess = [ np.average( abs(naGuess - naTest[:,-1]) ) ] * len(lfRes)
    
    fAvgRets = np.average(naTest[:,-1])
    
    plt.clf()
    plt.plot( llRange, lfRes )
    plt.plot( llRange, lfGuess )
    plt.title( 'Average error on average returns of %.04lf'%fAvgRets )
    plt.legend( ('Learner Predict', 'Average Return Predict') )
    plt.xlabel('K value')
    plt.ylabel('Error')
    plt.show()
    plt.savefig( 'FeatureTest.png', format='png' )
Should raise an exception.
dataset/ETHPy150Open tucker777/QSTK/Examples/Features/featuretest.py/learnerTest--crossover with--dataset/ETHPy150Open callowayproject/django-categories/categories/tests/test_category_import.py/CategoryImportTest.testMixingTabsSpaces