scikit-learn - StackingClassifier final_estimator 网格搜索
问题描述
我正在使用 StackingClassifier,将 RandomForest 和 BaggedLogisticRegression 作为第一层estimators
,将 LogisticRegression 作为final_estmator
. 我使用以下参数运行 RandomizedSearch:
params = {
'random_forest__max_depth': [3, 7, 10],
'random_forest__n_estimators': [100, 150],
'logreg_bagged__base_estimator__max_iter': [10000],
'logreg_bagged__base_estimator__C': [10000, 20000, 100000],
'logreg_bagged__base_estimator__class_weight': [{0: neg, 1: pos} for neg, pos in
[(1 - ((val + 1) * 0.01), (val + 1) * 0.01) for val in range(5)]
],
'final_estimator__max_iter': [10000],
'final_estimator__C': np.logspace(-4, 4, 4),
'final_estimator__class_weight': [{0: neg, 1: pos} for neg, pos in
[(1 - ((val + 1) * 0.01), (val + 1) * 0.01) for val in range(5)]
],
}
random_forest 和 logreg_bagged 参数按预期运行,但我似乎无法访问 final_estimator 参数以将它们包含在超参数调整中。有谁知道将其包含到搜索空间中的方法?
这是模型图: Model_diagram
解决方案
推荐阅读
- ios - 运行 Xcode 模拟器时出错 - '[framework] CUIThemeStore: No theme registered with id=0'
- acumatica - 在销售订单屏幕中更改运费税类别不会重新计算运费税
- react-native - 导航返回时刷新数据反应本机
- visual-studio - 在 Visual Studio 中导入项目时出现错误 MSB4019
- generics - 语法:多个泛型约束和继承、接口
- jenkins - 更改 Jenkins 并发作业工作区命名
- coldfusion - queryEach 或 .each() 不适用于 CF 11,为什么?
- ios - 第二个 ViewController 在返回时不显示信息
- r - 向量将不接受结果(将其返回为空白)
- c# - SMTP 服务器需要安全连接或客户端未通过身份验证。服务器响应是:5.5.1 Authentication Required