Last active
November 1, 2018 04:58
-
-
Save stsievert/0b8050ad5bb7c959d27f3f773793cdb9 to your computer and use it in GitHub Desktop.
This file contains 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
from dask_ml.model_selection import RandomizedSearchCV | |
from dask_ml.wrappers import Incremental | |
from dask_ml.datasets import make_classification | |
from sklearn.linear_model import SGDClassifier | |
import numpy as np | |
from sklearn.model_selection import KFold | |
X, y = make_classification(chunks=20) | |
params = {'estimator__alpha': np.logspace(-3, 0)} | |
search = RandomizedSearchCV(Incremental(SGDClassifier()), params, cv=KFold(5)) | |
search.fit(X, y, classes=[0, 1]) | |
print(search.best_score_) | |
print(search.best_params_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment