본문 바로가기
Tools

XGBR

by wycho 2021. 6. 7.

Extreme Gradient Boosting Regression

https://xgboost.readthedocs.io/en/latest/tutorials/model.html

 

model = xgboost.XGBRegressor(tree_method='gpu_hist', gpu_id=0)
model.fit(X_train, y_train)

shap_values = shap.TreeExplainer(model).shap_values(X_test)
shap_values = shap.Explainer(model, X_train)(X_test)

or -----------------------------

n_trees = 200
dmat  = xgboost.DMatrix(X_train, y_train)
model = xgboost.train({"tree_method": "gpu_hist"}, dmat, n_trees)
model.set_param({"predictor": "gpu_predictor"})

shap_values = model.predict(dmat, pred_contribs=True)

 

'Tools' 카테고리의 다른 글

VCF reheader  (0) 2021.06.17
Clustering  (0) 2021.06.09
SHAP - impact  (0) 2021.06.06
Excel to tsv  (0) 2021.05.19
PyHLA form  (0) 2021.05.13

댓글