Sfoglia il codice sorgente

update number of parameters for svm

Jérôme BUISINE 3 anni fa
parent
commit
0b94c18199
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      models.py

+ 3 - 3
models.py

@@ -25,13 +25,13 @@ from sklearn.model_selection import KFold, cross_val_score
 
 def _get_best_model(X_train, y_train):
 
-    Cs = [0.01, 0.1, 10, 100, 1000]
-    gammas = [0.01, 0.1, 10, 100]
+    Cs = [0.001, 0.01, 0.1, 1, 5, 10, 100, 1000]
+    gammas = [0.001, 0.01, 0.1, 1, 5, 10, 100, 1000]
     param_grid = {'kernel':['rbf'], 'C': Cs, 'gamma' : gammas}
 
     svc = svm.SVC(probability=True, class_weight='balanced')
     #clf = GridSearchCV(svc, param_grid, cv=5, verbose=1, scoring=my_accuracy_scorer, n_jobs=-1)
-    clf = GridSearchCV(svc, param_grid, cv=5, verbose=1, n_jobs=-1)
+    clf = GridSearchCV(svc, param_grid, cv=10, verbose=2, n_jobs=-1)
 
     clf.fit(X_train, y_train)