scikit-learn - 随机森林特征重要性显示列表中间全零的变量
问题描述
我使用以下代码对一些具有 10000 行和大约 700 个变量的数据运行了随机森林回归器
X_train, X_test, y_train, y_test = train_test_split(features, labels, test_size = 0.25, random_state = 42)
model = RandomForestRegressor(n_estimators = 1000, max_depth=20)
model.fit(X_train, y_train[:,0])
我的一个变量包含全零,但是当我查看有序列表时它显示了大约一半
model.feature_importances_
随机森林如何使用包含每个数据点为零的列而不是其他非静态列?
解决方案
推荐阅读
- java - 关于 Solace 属性何时有效的困惑
- html - 如何防止我的背景视频扩展超过一个部分?
- wpf - 如何设置控件属性(位于 DataTemplate 和 UserControl 内)的绑定以使用 ItemSource 的给定属性?
- ruby-on-rails - Rails 突然动作控制器异常
- python - 如何在嵌套的for循环中解析来自两个具有相似键和不同值的api调用的json响应
- javascript - 递归 HTTP 调用 - 从回调管道解析数据
- reinforcement-learning - 这是真的 ?预期 SARSA 和双 Q-Learning 怎么样?
- python - 获取OpenCV中多个小轮廓的外轮廓
- r - 在 R 中读取 xlsx 文件时如何使用错误处理?
- javascript - 在 Node.js 上运行多个物理世界,而不是充分利用服务器