pip install lightgbm
or conda install lightgbm
or brew install lightgbm
pip install lightgbm
경우 → Image not found 오류conda install lightgbm
or brew install lightgbm
→ knerl 연결 중단 오류brew install gcc@8
brew install cmake
git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM
export CXX=g++-8 CC=gcc-8
mkdir build
cd build
cmake ..
make -j4
pip install --no-binary :all: lightgbm
import time
import warnings
from lightgbm import LGBMClassifier
from sklearn.metrics import accuracy_score
warnings.filterwarnings('ignore')
evals= [(X_test.values, y_test)]
start_time = time.time()
lgbm = LGBMClassifier(n_estimators=400)
lgbm.fit(X_train.values, y_train, early_stopping_rounds=100, eval_set=evals)
print('Fit time: ', time.time() - start_time)
print(accuracy_score(y_test, lgbm.predict(X_test.values)))
'''
Fit time: 282.9081630706787
0.8666440447913132
'''
Reference
1) 제로베이스 데이터스쿨 강의자료
2) https://lsjsj92.tistory.com/622