关于《Hands-on Machine Learning》中超参数调优组合重复的疑问
确认超参数调优组合中的重复项
你观察得没错,这段param_grid里确实存在重复的超参数组合。
我们可以把两个字典各自生成的组合拆解出来:
第一个字典生成的组合:
- (
preprocessing__geo__n_clusters=5,random_forest__max_features=4) - (
preprocessing__geo__n_clusters=5,random_forest__max_features=6) - (
preprocessing__geo__n_clusters=5,random_forest__max_features=8) - (
preprocessing__geo__n_clusters=8,random_forest__max_features=4) - (
preprocessing__geo__n_clusters=8,random_forest__max_features=6) - (
preprocessing__geo__n_clusters=8,random_forest__max_features=8) - (
preprocessing__geo__n_clusters=10,random_forest__max_features=4) - (
preprocessing__geo__n_clusters=10,random_forest__max_features=6) - (
preprocessing__geo__n_clusters=10,random_forest__max_features=8)
- (
第二个字典生成的组合:
- (
preprocessing__geo__n_clusters=10,random_forest__max_features=6) - (
preprocessing__geo__n_clusters=10,random_forest__max_features=8) - (
preprocessing__geo__n_clusters=10,random_forest__max_features=10) - (
preprocessing__geo__n_clusters=15,random_forest__max_features=6) - (
preprocessing__geo__n_clusters=15,random_forest__max_features=8) - (
preprocessing__geo__n_clusters=15,random_forest__max_features=10)
- (
其中重复的组合是:
- (
preprocessing__geo__n_clusters=10,random_forest__max_features=6) - (
preprocessing__geo__n_clusters=10,random_forest__max_features=8)
这种重复大概率是笔误;也有可能是作者想针对这两组组合增加训练次数(如果使用GridSearchCV,重复组合会被多次训练),但这种情况比较少见——通常超参数调优会尽量避免冗余组合以节省计算资源。
内容的提问来源于stack exchange,提问作者med hannioui
相关产品推荐
相关产品推荐

