I am under anaconda notebook.
I have recently installed xgboost but I cannot access XGBClassifier :
from xgboost import XGBClassifier
When I import only xgboost and write xgboost it prints that the module is here ..
I am under anaconda notebook.
I have recently installed xgboost but I cannot access XGBClassifier :
from xgboost import XGBClassifier
When I import only xgboost and write xgboost it prints that the module is here ..
The issue was that I did not install xgboost for anaconda, so writing :
conda install -c conda-forge xgboost=0.6a2
solved my problem, thank you
Mine works after renaming the py file I was working on. I my case, from 'xgboost' to something else.
P.S. Restarting anaconda/spyder didn't work for me
The issue was that I did not install xgboost for anaconda, so writing :
conda install -c conda-forge xgboost=0.6a2
solved my problem, thank you
use this instead : -
import xgboost as xgb
xgb_regressor = xgb.XGBRegressor()
This worked for me.......
Install xgboost in anaconda, conda install conda-forge::xgboost
Install xgboost on anaconda3, pip install xgboost
After that when importing the library use
from xgboost.sklearn import XGBRegressor
Works perfectly
© 2022 - 2024 — McMap. All rights reserved.