私は、Scikitスコアリング関数のドキュメントで回答掘り出しを見つけることになりました。
負のラベルに従ってスコアを計算することができます。スコアを「正のラベル」(スコアリングのみ)として再定義することができます。例:
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import precision_score, make scorer
# here the scoring function is created. make_scorer passes the pos_label=0
# argument to sklearn.metrics.precision_score() to create the desired function.
neg_precision = make_scorer(precision_score, pos_label=0)
# some random C parameters for completion
params = {'C': [0.01, 0.03, 0.1, 0.3, 1, 3, 10]}
clf = GridSearchCV(LinearSVC(class_weight='balanced'), cv=10,param_grid=params, scoring=neg_precision)
clf.fit(X, y)
私は個人的にスコアリング= 'f1_macro'を使用することに決めました。これは、正のラベルのf1スコアと負のラベルのf1スコアの重み付けされていない平均を計算します。それは私が後にした結果をもたらしました。