以下の内容はhttps://anton0825.hatenablog.com/entry/2017/07/12/000000より取得しました。


XGBoostモデルでpredictすると「AttributeError: 'numpy.ndarray' object has no attribute 'feature_names'」エラー

原因はXGBoostのpredictにはndarrayでなく、xgboost.DMatrixを渡さないといけないため。 xgb.DMatrix(x_df)のようにpd.DataFrameをDMatrixに変換して渡すと直った。

参考:

stackoverflow.com




以上の内容はhttps://anton0825.hatenablog.com/entry/2017/07/12/000000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14