Skip to content

Commit

Permalink
update parameter value for sklearn 0.17
Browse files Browse the repository at this point in the history
sklearn 0.17 changes the class_weight argument value 'auto' to 'balanced'.
  • Loading branch information
ShengKungYi committed Nov 13, 2015
1 parent dfa6953 commit 8b79cb9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pca/eigenfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
'C': [1e3, 5e3, 1e4, 5e4, 1e5],
'gamma': [0.0001, 0.0005, 0.001, 0.005, 0.01, 0.1],
}
clf = GridSearchCV(SVC(kernel='rbf', class_weight='auto'), param_grid)
# for sklearn version 0.16 or prior, the class_weight parameter value is 'auto'
clf = GridSearchCV(SVC(kernel='rbf', class_weight='balanced'), param_grid)
clf = clf.fit(X_train_pca, y_train)
print "done in %0.3fs" % (time() - t0)
print "Best estimator found by grid search:"
Expand Down

0 comments on commit 8b79cb9

Please sign in to comment.