3
我通过其scikit学习风格的Python接口调用xgboost:xgboost是否有feature_importances_?
model = xgboost.XGBRegressor()
%time model.fit(trainX, trainY)
testY = model.predict(testX)
一些sklearn模型告诉你他们通过属性feature_importances
分配给其功能的重要性。这似乎并不为XGBRegressor
存在:
model.feature_importances_
AttributeError Traceback (most recent call last)
<ipython-input-36-fbaa36f9f167> in <module>()
----> 1 model.feature_importances_
AttributeError: 'XGBRegressor' object has no attribute 'feature_importances_'
奇怪的是:我的一个合作者属性feature_importances_
是存在的!可能是什么问题?
这些都是我的版本:
In [2]: xgboost.__version__
Out[2]: '0.6'
In [4]: sklearn.__version__
Out[4]: '0.18.1'
...和xgboost C来自github上++库,提交ef8d92fc52c674c44b824949388e72175f72e4d1
。
这是问题,谢谢 - 似乎通过点分发的软件包已过时。 – clstaudt