Problem
I am trying to use scikit-learn LogisticRegressionCVwith roc_auc_scoreas a score indicator.
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
clf = LogisticRegressionCV(scoring=roc_auc_score)
But when I try to fit the model ( clf.fit(X, y)), it throws an error.
ValueError: average has to be one of (None, 'micro', 'macro', 'weighted', 'samples')
That's cool. It is clear what is happening: roc_auc_scoreit is necessary to call with the argument averagespecified in its documentation and the above error. So I tried this.
clf = LogisticRegressionCV(scoring=roc_auc_score(average='weighted'))
But it turns out that roc_auc_scoreyou cannot call only with an optional argument, because it causes another error.
TypeError: roc_auc_score() takes at least 2 arguments (1 given)
Question
Any thoughts on how I can use it roc_auc_scoreas a measure of the score LogisticRegressionCVso that I can specify an argument for the scoring function?
SO- scikit-learn GitHub repo, - ?