首页 > 解决方案 > 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()吗?

标签: pythonscikit-learn

解决方案


推荐阅读