Code: Select all
from sklearn.svm import OneClassSVM
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import precision, recall, f1_score
grid = {'nu' : [0.02, 0.03],
'kernel' : ['poly', 'sigmoid', 'linear', 'rbf'],
'degree' : [1,3,5,7],
'gamma' : [.01, .1, 1, 10, 500]
'coeff0' : [1,2,3]
}
mod = GridSearchCV(OneClassSVM(),
grid,
cv = 3,
scoring = ['f1', 'precision', 'recall'],
refit = 'f1',
return_train_score = True)
Hier hat das y nur Nullen und Einsen (im Wesentlichen resigniert oder nicht), aber ich bin mir nicht sicher, warum ich bekomme:
Code: Select all
ValueError: Target is multiclass but average='binary'. Please choose another average setting, one of [None, 'micro', 'macro', 'weighted']