-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Enabling Grid Search using AUC #450
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
I know I add the same issue. As a workaround I did: ...
class AUCSGDClassifier(linear_model.SGDClassifier):
def score(self, X, y):
probas = self.predict_proba(X)
fpr, tpr, thresholds = roc_curve(y, probas)
return auc(fpr, tpr)
print "Fitting a model on the training set"
clf = AUCSGDClassifier(loss='log', alpha=1e-4, n_iter=5)
# check the cross validated score on the development set
print cross_val_score(clf, X_train_transformed, y_train).mean() I wonder how we could extend / refactor the scoring or grid search API to allow for "clf-aware" score functions. |
Thanks for your code. I also used a work around. I would like the fit_grid_point to use the decision_function instead of predict. |
The current |
I am just considering doing this. But it seems ugly :-/ Also, current AUC methods only support the binary case. So should we start implementing the multi-class and multi-label cases first? I think I might do a hack that allows us to do this for the binary case. |
Hm are you sure the code you posted above does what it is supposed to do? |
Closed via #1381. |
Grid search is currently not possible with auc score since fit_grid_point calls "predict" on the classifier.
The text was updated successfully, but these errors were encountered: