Created
July 25, 2017 11:44
-
-
Save drorata/f3f8632f4b0f16dbfb861d791936e182 to your computer and use it in GitHub Desktop.
Minimal example of using
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.4) | |
| parameters = { | |
| 'clf__C': [0.01, 0.1, 1, 2, 5, 10, 50, 100], | |
| 'clf__class_weight': [ | |
| {0: 1, 1: 1}, | |
| {0: 2, 1: 1}, {0:1, 1:2}, | |
| {0: 5, 1: 1}, {0:1, 1:5}] | |
| } | |
| clf = GridSearchCV(estimator, parameters, cv=15, scoring=make_scorer(recall_score), n_jobs=-1) | |
| clf.fit(X_train, Y_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment