Suppose I want to do a RandomizedSearchCV with custom both estimator and scorer :
RandomizedSearchCV(cxCustomLogReg(), search_space,
n_iter=50, scoring=scorer)
May it be possible, during randomized search, to pass the estimator obtained after fitting cxCustomLogReg() to scorer function as a parameter (and not only y_true/y_pred values as usual)?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
This is actually the expected format. When scoring is a callable, it should have signature (fitted_estimator, X_test, y_test).
You may be using the helper make_scorer, which converts a metric function with signature (y_true, y_pred) into a scoring function as described above. Just don’t use that helper, and define your scorer directly.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0