【发布时间】:2025-12-04 17:10:01
【问题描述】:
如果是 3 列数据,(在我的测试用例中)我可以看到所有列的值都相等。
random_forest.feature_importances_
array([0.3131602 , 0.31915436, 0.36768544])
有没有办法将等待时间添加到其中一列?
更新:
我想在这种情况下可以使用 xgboost。 我试过了,但得到这个错误:
import xgboost as xgb
param = {}
num_round = 2
dtrain = xgb.DMatrix(X, y)
dtest = xgb.DMatrix(x_test_split)
dtrain_split = xgb.DMatrix(X_train, label=y_train)
dtest_split = xgb.DMatrix(X_test)
gbdt = xgb.train(param, dtrain_split, num_round)
y_predicted = gbdt.predict(dtest_split)
rmse_pred_vs_actual = xgb.rmse(y_predicted, y_test)
AttributeError: 模块“xgboost”没有属性“rmse”
【问题讨论】:
-
简而言之,不要这样做。 *.com/questions/38034702/…
标签: machine-learning scikit-learn random-forest xgboost