오답노트
[ML] Boosting - CatBoost 실습 본문
CatBoostRegressor
# pip install catboost
import catboost as cbt
model_cbt = cbt.CatBoostRegressor()
params_cbt = {'depth' : [4,5,6,7,8,9, 10],
'learning_rate' : [0.01,0.02,0.03,0.04],
'iterations' : [10 ,30,50,70, 100]
}
model_cbt_g = GridSearchCV(model_cbt,params_cbt,cv=10,verbose=3)
model_cbt_g.fit(x_train,y_train)
pred_cbt = model_cbt_g.predict(x_val)
ufs.Regressor_report(y_val,pred_cbt)
pip install catboost 를 통해 catboost를 먼저 설치해야 한다.
사용법은 Regressor와 Classifier와 같다.
hyper parameter
- depth : 트리 모델의 크기를 정할 수 있다.
- learning_rate : 각 모델의 예측값에 대한 비율을 설정할 수 있다.
- iterations : 트리 모델의 개수를 정할 수 있다.
'Python > ML' 카테고리의 다른 글
[RS] 협업 필터링 (Collaborative Filtering) (0) | 2023.03.03 |
---|---|
[RS] 컨텐트 기반 필터링 (Content-based Filtering) (0) | 2023.03.02 |
[ML] Boosting - CatBoost 이론 (0) | 2022.09.09 |
[ML] 모델에 대한 설명 - Shapley Additive Explanations(SHAP) (0) | 2022.09.06 |
[ML] 모델에 대한 설명 - Partial Dependence Plots (0) | 2022.09.05 |