Skip to content

Commit afa8a5e

Browse files
authored
Update DVCLive xgboost snippet (#4847)
1 parent 8af6e5e commit afa8a5e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

extension/snippets/dvclive.code-snippets

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,17 @@
100100
"body": [
101101
"from dvclive.xgb import DVCLiveCallback",
102102
"",
103-
"xgboost.train(",
104-
" ${1:param}, ${2:dtrain}, num_round=${3:5}, evals=[${4:(dval, \"eval_data\")}]",
105-
" callbacks=[DVCLiveCallback(${5:\"eval_data\"}, save_dvc_exp=True)],",
103+
"model = xgb.XGBClassifier(",
104+
" n_estimators=${1:100},",
105+
" early_stopping_rounds=${2:5},",
106+
" eval_metric=[${3:\"merror\", \"mlogloss\"}],",
107+
" callbacks=[DVCLiveCallback()]",
108+
")",
109+
"",
110+
"model.fit(",
111+
" X_train,",
112+
" y_train,",
113+
" eval_set=[(X_test, y_test)]",
106114
")"
107115
],
108116
"description": "DVCLive XGBoost callback"

0 commit comments

Comments
 (0)