drscotthawley / panotti

A multi-channel neural network audio classifier using Keras
MIT License
271 stars 72 forks source link

eval_network error #54

Open ngragaei opened 4 years ago

ngragaei commented 4 years ago

File "D:/Anaconda3/Lib/site-packages/panotti-master/eval_network.py", line 141, in eval_network(weights_file=args.weights, classpath=args.classpath, batch_size=args.batch_size)

File "D:/Anaconda3/Lib/site-packages/panotti-master/eval_network.py", line 91, in evalnetwork fpr[i], tpr[i], = roc_curve(Y_test[:, i], y_scores[:, i])

File "D:\Anaconda3\lib\site-packages\sklearn\metrics\ranking.py", line 622, in roc_curve y_true, y_score, pos_label=pos_label, sample_weight=sample_weight)

File "D:\Anaconda3\lib\site-packages\sklearn\metrics\ranking.py", line 396, in _binary_clf_curve raise ValueError("{0} format is not supported".format(y_type))

ValueError: continuous format is not supported

BoulderLou commented 4 years ago

one solution is to convert the contents of the floating point arrays to integer values

fpr[i], tpr[i], _ = roc_curve(np.rint(Y_test[:, i]), np.rint(y_scores[:, i]))

auc_score = roc_auc_score(np.rint(Y_test), np.rint(y_scores))

mazimiucc commented 3 years ago

Traceback (most recent call last): File "eval_network.py", line 135, in eval_network(weights_file=args.weights, classpath=args.classpath, batch_size=args.batch_size) File "eval_network.py", line 85, in evalnetwork fpr[i], tpr[i], = roc_curve(Y_test[:, i], y_scores[:, i]) File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\utils\validation.py", line 63, in inner_f return f(*args, **kwargs) File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\metrics_ranking.py", line 914, in roc_curve y_true, y_score, pos_label=pos_label, sample_weight=sample_weight) File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\metrics_ranking.py", line 691, in _binary_clf_curve raise ValueError("{0} format is not supported".format(y_type)) ValueError: continuous format is not supported

mazimiucc commented 3 years ago

one solution is to convert the contents of the floating point arrays to integer values

fpr[i], tpr[i], _ = roc_curve(np.rint(Y_test[:, i]), np.rint(y_scores[:, i]))

auc_score = roc_auc_score(np.rint(Y_test), np.rint(y_scores))

Solved!