xgboost的plotting API狀態:XGBoost情節重要性沒有財產max_num_features
xgboost.plot_importance(booster, ax=None, height=0.2, xlim=None, ylim=None, title='Feature importance', xlabel='F score', ylabel='Features', importance_type='weight', max_num_features=None, grid=True, **kwargs)¶
情節重要性基礎上裝配樹。
參數:
booster (Booster, XGBModel or dict) – Booster or XGBModel instance, or dict taken by Booster.get_fscore()
...
max_num_features (int, default None) – Maximum number of top features displayed on plot. If None, all features will be displayed.
我在執行,但是,在運行:
booster_ = XGBClassifier(learning_rate=0.1, max_depth=3, n_estimators=100,
silent=False, objective='binary:logistic', nthread=-1,
gamma=0, min_child_weight=1, max_delta_step=0, subsample=1,
colsample_bytree=1, colsample_bylevel=1, reg_alpha=0,
reg_lambda=1, scale_pos_weight=1, base_score=0.5, seed=0)
booster_.fit(X_train, y_train)
from xgboost import plot_importance
plot_importance(booster_, max_num_features=10)
返回:
AttributeError: Unknown property max_num_features
在運行它沒有參數max_num_features
地塊正確整個功能集(在我的情況下是巨大的,〜10K的功能)。 關於發生了什麼的任何想法?
在此先感謝。
詳情:
> python -V
Python 2.7.12 :: Anaconda custom (x86_64)
> pip freeze | grep xgboost
xgboost==0.4a30
是的! XGboost沒有最好的文檔,但找出它的工作後。我會接受你的回答,因爲它現在更加相關(有人問過這個問題)。 –