-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
BUG: Using GridSearchCV with scoring='roc_auc' and GMM as classifier gives IndexError #7598
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
Comments
Updated to 0.17.1 and issue persists ( Changing GMM to GaussianMixture) |
The error is strange, but GMM is not a supervised model, so AUC doesn't really make sense. |
Do you really mean updated to 0.17.1, not 0.18? On 8 October 2016 at 03:28, Andreas Mueller notifications@github.com
|
Getting the same error with
Log:
|
It looks there like you might have been training your Yes, this error message is not very helpful. |
I ran into this error and you are correct @amueller about the single class explanation. Here's what my data looks like.
So my data contains a single class: Perhaps, a more descriptive error message would help. Something along the line of your comment: |
Can someone help with this issue? I do not know how to fix it still. Thank you! |
clf = ExtraTreesClassifier() param_grid = { clf = GridSearchCV(estimator=clf, param_grid=param_grid, cv=my_cv, n_jobs=-1, scoring='roc_auc', return_train_score=False) |
@liuwanfei you likely have just one class in |
Yes, what the people above have mentioned is correct - if you train with one class you will get this error. However, if you have a look at my code, I generated a dataset which has 2 classes so that was not the case with me. What was the causing the issue is that my param grid was set up with a subtle error. Remember the "roc_auc" scorer is using probabilities as inputs to create the ROC curve, and in my example above, my parameter space for If you think about it, a GMM with one component will output only one probability. Thus, the output of So, for your case, see if one of the parameter combinations might not result in the classifier being constrained to predicting a single class. P.S I only realised this now, almost 2 years after the post. lol |
I and @reshamas are working on it |
…orer (scikit-learn#12486) Continues and resolves scikit-learn#12221, fixes scikit-learn#7598
…orer (scikit-learn#12486) Continues and resolves scikit-learn#12221, fixes scikit-learn#7598
…orer (scikit-learn#12486) Continues and resolves scikit-learn#12221, fixes scikit-learn#7598
When performing grid search using GridSearchCV using ootb scoring method 'roc_auc' and ootb GMM classifier from sklearn.mixture.GMM I get an index error.
Code to reproduce:
Sorry if the format is incorrect. First time I am posting.
ERROR:
File "*/python2.7/site-packages/sklearn/metrics/scorer.py", line 175, in call
y_pred = y_pred[:, 1]
IndexError: index 1 is out of bounds for axis 1 with size 1
The text was updated successfully, but these errors were encountered: