<RandomizedSearchCV>将拟合后得到的estimator作为参数传给scoring function

<RandomizedSearchCV> Pass the estimator obtained after fitting to scoring function as a parameter

假设我想做一个带有自定义估算器和评分器的 RandomizedSearchCV :

RandomizedSearchCV(cxCustomLogReg(), search_space,
                   n_iter=50, scoring=scorer) 

有没有可能,在随机搜索中,将cxCustomLogReg()拟合到scorer函数后获得的估计量作为参数传递(而不仅仅是y_true/y_pred 值照常)?

这实际上是预期的格式。当 scoring 是可调用的时,它应该有签名 (fitted_estimator, X_test, y_test).

您可能正在使用助手 make_scorer,它将带有签名 (y_true, y_pred) 的度量函数转换为如上所述的评分函数。只是不要使用那个助手,直接定义你的得分手。