def get_models(test):
return [
(LinearSVC, {
'C': [0.01, 0.1, 1.0, 10.0],
'multi_class': ['ovr', 'crammer_singer'],
}),
] + ([
(KNeighborsClassifier, {
'weights': ['uniform', 'distance'],
}),
(SVC, {
'C': [0.01, 0.1, 1.0, 10.0, 100.0],
'kernel': ['linear', 'poly', 'rbf', 'sigmoid'],
'decision_function_shape': ['ovr', 'ovo'],
}),
(RandomForestClassifier, {
'criterion': ['gini', 'entropy'],
'min_samples_split': [5, 10, 25],
'min_samples_leaf': [5, 10, 25],
'n_estimators': [5, 10, 50, 100],
})
] if not test else [])
评论列表
文章目录