xgboostにDMatrixが存在しないと言われる

xgboostのDMatrixを利用しようと次のようなコードを書いた。
import xgboost as xgbxgb.DMatrix(data)実行するとエラーになる。
raceback (most recent call last): File "xgboost.py", line 19, in <module> import xgboost as xgb File "/opt/kaggle/titanic/xgboost.py", line 26, in <module> print(xgb.DMatrix)AttributeError: module 'xgboost' has no attribute 'DMatrix'このコードのファイル名をxgboost.pyとしていたので、この中にDMatrixが無いということだった。ファイル名を変えると無事に動いた。言いたことは色々あるが、Pythonだから仕方なし。
スポンサーリンク
スポンサーリンク





