Commit 0f3c2dac by Vik Paruchuri

Patch cv error estimate generation

parent 844d0f7b
......@@ -90,7 +90,7 @@ def get_cv_error(clf,feats,scores):
results={'success' : False, 'kappa' : 0, 'mae' : 0}
try:
cv_preds=util_functions.gen_cv_preds(clf,feats,scores)
err=numpy.mean(numpy.abs(cv_preds-scores))
err=numpy.mean(numpy.abs(numpy.array(cv_preds)-scores))
kappa=util_functions.quadratic_weighted_kappa(list(cv_preds),scores)
results['mae']=err
results['kappa']=kappa
......
......@@ -46,6 +46,8 @@ for filename in filenames:
print err
kappa=util_functions.quadratic_weighted_kappa(list(cv_preds),scores)
print kappa
percent_error = numpy.mean(numpy.abs(scores - numpy.array(cv_preds))/scores)
print percent_error
outfile=open(filename + "_cvout.tsv",'w+')
outfile.write("cv_pred" + "\t" + "actual\n")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment