Skip to content

Commit

Permalink
Update DVCLive xgboost snippet (#4847)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Oct 17, 2023
1 parent 8af6e5e commit afa8a5e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions extension/snippets/dvclive.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@
"body": [
"from dvclive.xgb import DVCLiveCallback",
"",
"xgboost.train(",
" ${1:param}, ${2:dtrain}, num_round=${3:5}, evals=[${4:(dval, \"eval_data\")}]",
" callbacks=[DVCLiveCallback(${5:\"eval_data\"}, save_dvc_exp=True)],",
"model = xgb.XGBClassifier(",
" n_estimators=${1:100},",
" early_stopping_rounds=${2:5},",
" eval_metric=[${3:\"merror\", \"mlogloss\"}],",
" callbacks=[DVCLiveCallback()]",
")",
"",
"model.fit(",
" X_train,",
" y_train,",
" eval_set=[(X_test, y_test)]",
")"
],
"description": "DVCLive XGBoost callback"
Expand Down

0 comments on commit afa8a5e

Please sign in to comment.