shankarpandala / lazypredict

Lazy Predict help build a lot of basic models without much code and helps understand which models works better without any parameter tuning
MIT License
2.86k stars 329 forks source link

AttributeError: module 'lightgbm' has no attribute 'LGBMRegressor' #315

Closed foreseez closed 3 years ago

foreseez commented 3 years ago

AttributeError Traceback (most recent call last)

in ----> 1 from lazypredict.Supervised import LazyClassifier, LazyRegressor 2 from sklearn.model_selection import train_test_split 3 from sklearn import datasets 4 from lightgbm import * ~/opt/anaconda3/lib/python3.7/site-packages/lazypredict/Supervised.py in 77 78 REGRESSORS.append(('XGBRegressor', xgboost.XGBRegressor)) ---> 79 REGRESSORS.append(('LGBMRegressor',lightgbm.LGBMRegressor)) 80 # REGRESSORS.append(('CatBoostRegressor',catboost.CatBoostRegressor)) 81 AttributeError: module 'lightgbm' has no attribute 'LGBMRegressor' ------ MacOs 10.15.7 lightgbm 3.1.1 lazypredict 0.2.7 it show this error why ?
shyamcody commented 3 years ago

Is this a relevant answer for you? is it possible that your script name is lightgbm.py. That ends up creating this issue. Check for example this issue as well where the solution is again same. If your script name is lightgbm.py then change it and should see no further confusion.

brendalf commented 3 years ago

Hi @zyjcs, the @shyamcody answer solved your problem? Please, let us know

foreseez commented 3 years ago

Hi @zyjcs, the @shyamcody answer solved your problem? Please, let us know

It's ok ~ Thank you very much. You do a great jobs.