使用 Scikit-Learn 的 RandomizedSearchCV 模块,如何保证某一组超参数设置全部被测试?

Using Scikit-Learn's RandomizedSearchCV module, how do you guarantee a certain set of hyper-parameter settings will all be tested?

使用Scikit-Learn的RandomizedSearchCV模块,如何保证某一组超参数设置全部被测试?

我的目标是保证通过随机搜索最佳估计器超参数,测试 sklearn MLPClassifier 的所有可用激活函数。不过,我也想要一个适用于 Python 机器学习 models/estimators 的答案。我相信我可以通过 运行 RandomizedSearchCVGridSearchCV 使用 MLPClassifier 的 3 个不同实例来测试哪个激活函数是最好的。问题是,如果我想测试所有可用的激活函数和所有权重“求解器”以及其他参数(例如神经元数量和层数)怎么办?有没有办法使用 Python 库来做到这一点?

我只发布这个答案,因为问题下面的评论对我来说是最好的答案。

desertnaut 于 2020 年 8 月 8 日发表的评论:

You cannot; RandomizedSearchCV provides absolutely no such guarantees. You should revert to GridSearchCV if you want to be sure that certain combinations will be tested.

目前最好的解决方案是结合使用 RandomizedSearchCVGridSearchCV