def evaluation(y_test=None, y_predict=None, n_classes=None):
 from sklearn.metrics import confusion_matrix, f1_score, accuracy_score
 c_mat = confusion_matrix(y_test, y_predict, labels=[x for x in range(n_classes)])
 f1 = f1_score(y_test, y_predict, average=None, labels=[x for x in range(n_classes)])
 f1_macro = f1_score(y_test, y_predict, average='macro')
 acc = accuracy_score(y_test, y_predict)
 print ('confusion matrix: \n', c_mat)
 print ('f1-score:', f1)
 print ('f1-score(macro):', f1_macro)
 print ('accuracy-score:', acc)
 return (c_mat, f1, acc, f1_macro)

def evaluation ( y_test = None , y_predict = None , n_classes = None ) : from sklearn . metrics import confusion_matrix , f1_score , accuracy_score c_mat = confusion_matrix ( y_test , y_predict , labels = [ x for x in range ( n_classes ) ] ) f1 = f1_score ( y_test , y_predict , average = None , labels = [ x for x in range ( n_classes ) ] ) f1_macro = f1_score ( y_test , y_predict , average = 'macro' ) acc = accuracy_score ( y_test , y_predict ) print ( 'confusion matrix: \n' , c_mat ) print ( 'f1-score:' , f1 ) print ( 'f1-score(macro):' , f1_macro ) print ( 'accuracy-score:' , acc ) return ( c_mat , f1 , acc , f1_macro )
input the predicted results .