Commit d9b47a73 by Vik Paruchuri

Fix some error handling

parent e86966aa
......@@ -56,7 +56,8 @@ def grade(grader_data,grader_config,submission,sandbox=None):
#Try to determine confidence level
try:
min_score=min(grader_data['score'])
min_score=min(numpy.asarray(grader_data['score']))
log.debug(grader_data['score'])
raw_confidence=grader_data['model'].predict_proba(grader_feats)[0,(results['score']-min_score)]
#TODO: Normalize confidence somehow here
results['confidence']=raw_confidence
......
......@@ -94,8 +94,11 @@ def get_cv_error(clf,feats,scores):
results['mae']=err
results['kappa']=kappa
results['success']=True
except ValueError:
#If this is hit, everything is fine. It is hard to explain why the error occurs, but it isn't a big deal.
log.exception("Not enough classes (0,1,etc) in each cross validation fold.")
except:
log.debug("Error getting cv error estimates.")
log.exception("Error getting cv error estimates.")
return results
......
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