Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. gs = GridSearchCV(estimator=some_classifier,
  2. param_grid=some_grid,
  3. cv=5,
  4. scoring=make_scorer(custom_scorer))
  5.  
  6. gs.fit(training_data, training_y)
  7.  
  8. def custom_scorer(y, y_pred):
  9. """
  10. (1) y contains ground truths, but only for the left-out fold
  11. (2) Similarly, y_pred contains predicted probabilities, but only for the left-out fold
  12. (3) So y, y_pred is each of length ~len(training_y)/5
  13. """
  14.  
  15. return scaler_value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement