Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "Only one class present in y_true. ROC AUC score is not defined in that case" #35

Open
gllort opened this issue Apr 25, 2018 · 0 comments

Comments

@gllort
Copy link

gllort commented Apr 25, 2018

Running the eval_network script I got the following error that arises after the predict phase. What could possibly cause this error? Thanks in advance!

Running predict...
Counting mistakes
Found 1846 total mistakes out of 16960 attempts
Mistakes by class:
...
/* details of the mistakes follow */
...
Measuring ROC...

/apps/K80/PYTHON/3.6.3_ML/lib/python3.6/site-packages/sklearn/metrics/ranking.py:571: UndefinedMetricWarning: No positive samples in y_true, true positive value should be meaningless
UndefinedMetricWarning)
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 88, in eval_network
auc_score = roc_auc_score(Y_test, y_scores)
File "/apps/K80/PYTHON/3.6.3_ML/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 277, in roc_auc_score
sample_weight=sample_weight)
File "/apps/K80/PYTHON/3.6.3_ML/lib/python3.6/site-packages/sklearn/metrics/base.py", line 118, in _average_binary_score
sample_weight=score_weight)
File "/apps/K80/PYTHON/3.6.3_ML/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 268, in _binary_roc_auc_score
raise ValueError("Only one class present in y_true. ROC AUC score "
ValueError: Only one class present in y_true. ROC AUC score is not defined in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant