Does xgboost have feature_importances_?

clstaudt

I'm calling xgboost via its scikit-learn-style Python interface:

model = xgboost.XGBRegressor() 
%time model.fit(trainX, trainY)
testY = model.predict(testX)

Some sklearn models tell you which importance they assign to features via the attribute feature_importances. This doesn't seem to exist for the 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_'

The weird thing is: For a collaborator of mine the attribute feature_importances_ is there! What could be the issue?

These are the versions I have:

In [2]: xgboost.__version__
Out[2]: '0.6'

In [4]: sklearn.__version__
Out[4]: '0.18.1'

... and the xgboost C++ library from github, commit ef8d92fc52c674c44b824949388e72175f72e4d1.

Jens Beyer

How did you install xgboost? Did you build the package after cloning it from github, as described in the doc?

http://xgboost.readthedocs.io/en/latest/build.html

As in this answer:

Feature Importance with XGBClassifier

There always seems to be a problem with the pip-installation and xgboost. Building and installing it from your build seems to help.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

xgboostとそのsklearnの統合feature_importances_エラー

分類Dev

xgboostにはfeature_importances_がありますか?

分類Dev

Does sed have a feature superior to awk?

分類Dev

TransformedTargetRegressorはfeature_importances_属性を継承しません

分類Dev

Python:RandomForestClassifierのfeature_importances_()を適切に呼び出す方法

分類Dev

Does Powershell have a feature like Bash's "autocd" shopt?

分類Dev

Does Jenkins have a feature like credentials for non-secrets?

分類Dev

最適なTPOTパイプラインを取得した後にfeature_importances_を取得しますか?

分類Dev

GridsearchCVからfeature_importances_を取得するにはどうすればよいですか

分類Dev

Scikit-learnのRandomForestRegressorで「feature_importances_」はどのように注文されますか

分類Dev

Does aiohttp have ORM?

分類Dev

Does D have reflection?

分類Dev

Why does '/' have an '..' entry?

分類Dev

Does Vala have typedefs?

分類Dev

How to check feature importances on text feature?

分類Dev

マルチラベル分類のためにOneVsRestClassifierからランダムフォレストfeature_importances_を取得する

分類Dev

extraTreesClassifierでNoneTypeとして表示されるfeature_importances_:TypeError: 'NoneType'オブジェクトは反復可能ではありません

分類Dev

Does Go have callback concept?

分類Dev

Why does Docker have a daemon?

分類Dev

Tenant does not have a SPO license

分類Dev

Does DynamoDB have locking by default?

分類Dev

Does PTS have to start at 0?

分類Dev

Does Euphoria language have a shell?

分類Dev

Does JMESPath have an identity function?

分類Dev

Does this AppendFormat have any value?

分類Dev

AudioContext does not have a pause property?

分類Dev

Does Dart have a comma operator?

分類Dev

does not have a Binding with the None MessageVersion

分類Dev

What parameters does ulimit have?

Related 関連記事

  1. 1

    xgboostとそのsklearnの統合feature_importances_エラー

  2. 2

    xgboostにはfeature_importances_がありますか?

  3. 3

    Does sed have a feature superior to awk?

  4. 4

    TransformedTargetRegressorはfeature_importances_属性を継承しません

  5. 5

    Python:RandomForestClassifierのfeature_importances_()を適切に呼び出す方法

  6. 6

    Does Powershell have a feature like Bash's "autocd" shopt?

  7. 7

    Does Jenkins have a feature like credentials for non-secrets?

  8. 8

    最適なTPOTパイプラインを取得した後にfeature_importances_を取得しますか?

  9. 9

    GridsearchCVからfeature_importances_を取得するにはどうすればよいですか

  10. 10

    Scikit-learnのRandomForestRegressorで「feature_importances_」はどのように注文されますか

  11. 11

    Does aiohttp have ORM?

  12. 12

    Does D have reflection?

  13. 13

    Why does '/' have an '..' entry?

  14. 14

    Does Vala have typedefs?

  15. 15

    How to check feature importances on text feature?

  16. 16

    マルチラベル分類のためにOneVsRestClassifierからランダムフォレストfeature_importances_を取得する

  17. 17

    extraTreesClassifierでNoneTypeとして表示されるfeature_importances_:TypeError: 'NoneType'オブジェクトは反復可能ではありません

  18. 18

    Does Go have callback concept?

  19. 19

    Why does Docker have a daemon?

  20. 20

    Tenant does not have a SPO license

  21. 21

    Does DynamoDB have locking by default?

  22. 22

    Does PTS have to start at 0?

  23. 23

    Does Euphoria language have a shell?

  24. 24

    Does JMESPath have an identity function?

  25. 25

    Does this AppendFormat have any value?

  26. 26

    AudioContext does not have a pause property?

  27. 27

    Does Dart have a comma operator?

  28. 28

    does not have a Binding with the None MessageVersion

  29. 29

    What parameters does ulimit have?

ホットタグ

アーカイブ