def evaluate(prediction,labels_test): labels_test = [0 if x=="neutral" else 1 if x=="positive" else -1 for x in labels_test] #logistic regression evaluation print "Average F1 : " +str(measures.avgF1(labels_test,prediction,-1,1)) #print "Baseline AverageF1 : " +str(measures.avgF1(labels_test,baseline_prediction)) print "Accuracy : " +str(measures.accuracy(labels_test,prediction)) #print "Baseline Accuracy : "+str(measures.accuracy(labels_test,baseline_prediction)) print "F1 negative : " +str(measures.F1(labels_test,prediction,-1)) print "F1 positive : " +str(measures.F1(labels_test,prediction,1)) print "Precision negative: " +str(measures.precision(labels_test,prediction,-1)) print "Precision positive: " +str(measures.precision(labels_test,prediction,1)) print "Recall negative : " +str(measures.recall(labels_test,prediction,-1)) print "Recall positive : " +str(measures.recall(labels_test,prediction,1))