-
Notifications
You must be signed in to change notification settings - Fork 285
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
ValueError: Found input variables with inconsistent numbers of samples #94
Comments
It will be easier to debug if you could post a minimal reproducible sample code that shows the error |
Here's the code I use: `labels_test = test.label #test_labels = labels_test.values.reshape((len(labels_test.values), 1)) skplt.metrics.plot_roc(labels_test.values, pred_w2v_cnn.values) Shape of test_labels: (143455, ) I tried to reshape the test_labels to (143455, 1), but that didn't work either. |
@AntonioAntovski 'plot_roc' function is based on sklearn's 'roc_curve' function, this function will check input data shape. Maybe you should not use the 'index' column, because your label is 7-classes, but you give your prediction probability result is 8D, so raise this error. Drop it, then plot again. For testing, this is new code:
|
I'm trying to plot the ROC curve, but I get ValueError: Found input variables with inconsistent numbers of samples.
Here's the code I use:
`skplt.metrics.plot_roc(labels_test.values, pred_w2v_cnn.values)
plt.show()`
Both labels_test.values and pred_w2v_cnn.values have the same length and both are of type np.ndarray. I'd be thankful if anyone can help me to solve this problem.
The text was updated successfully, but these errors were encountered: