SHARE
TWEET

Untitled

a guest May 25th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from sklearn.model_selection import GridSearchCV
  2. model_to_set = OneVsRestClassifier(SGDClassifier(loss='log', penalty='l1', class_weight="balanced"))
  3. parameters = {
  4.     "estimator__alpha": [10**-5,10**-4,  10**-3, 10**-1, 10**1]
  5. }
  6. model_tunning = GridSearchCV(model_to_set, param_grid=parameters, scoring='f1_micro',n_jobs=-1)
  7. model_tunning.fit(x_train_multilabel, y_train)
  8. print (model_tunning.best_score_)
  9. print (model_tunning.best_params_)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top