python - scikit-learn:从管道中检索模型对象
问题描述
我有以下管道构建,我想做的是获取在管道内构建的随机森林模型对象。这rf
是唯一的初始化,它没有rf.estimators_
grid_params = [{'bootstrap': [True],
'min_samples_leaf': [5],
'n_estimators': [1000],
'max_features': [8],
'min_samples_split': [12],
'max_depth': [60]}]
rf = RandomForestRegressor()
grid_search = GridSearchCV(estimator=rf, param_grid=grid_params)
pipe = PipelineRF(
[
('grid', grid_search)
]
)
_ = StratifiedKFold(random_state=125)
有办法打电话pipe.get_model()
吗?
解决方案
推荐阅读
- google-apps-script - 使用 Google Apps 脚本从 Google 文档中删除空白的最后一页空间、选项卡
- java - 如何使用 java-ee8、microProfile 4.0、Openliberty 21 和 Docker 设置特定于阶段的微配置文件配置
- javascript - 如何将焦点更改为表格单元格中的下一个或上一个可聚焦和启用的输入(仅限 jQuery 或 vanilla javascript)?
- vue.js - VUE JS - 仅通过路由器对象的推送/替换方法而不是通过 URL 栏来渲染页面
- javascript - 在 React Native 中循环 json 后的 if 语句
- excel - 删除工作表中不需要的行
- kubernetes - linkerd 使用 helm 或命名空间注入?
- python - 存储和加载实时绘图数据的最有效(速度方面)方式
- javascript - 使用 jQuery 将 CSS 选择器定位的 HTML 元素大写
- flutter - 如何在 Flutter 中的 Navigator.pop() 上设置不同的过渡动画?