Created
February 15, 2019 17:31
-
-
Save terrah27/b762c8f8de58892319e65214ed3f197b 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
loss = ['hinge', 'log', 'modified_huber', 'squared_hinge', 'perceptron'] | |
penalty = ['l1', 'l2', 'elasticnet'] | |
alpha = [0.0001, 0.001, 0.01, 0.1, 1, 10, 100, 1000] | |
learning_rate = ['constant', 'optimal', 'invscaling', 'adaptive'] | |
class_weight = [{1:0.5, 0:0.5}, {1:0.4, 0:0.6}, {1:0.6, 0:0.4}, {1:0.7, 0:0.3}] | |
eta0 = [1, 10, 100] | |
param_distributions = dict(loss=loss, | |
penalty=penalty, | |
alpha=alpha, | |
learning_rate=learning_rate, | |
class_weight=class_weight, | |
eta0=eta0) | |
random = RandomizedSearchCV(estimator=sgd, | |
param_distributions=param_distributions, | |
scoring='roc_auc', | |
verbose=1, n_jobs=-1, | |
n_iter=1000) | |
random_result = random.fit(X_train, y_train) | |
print('Best Score: ', random_result.best_score_) | |
print('Best Params: ', random_result.best_params_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment