Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cb.save.model

Callback closure for saving a model file.


Description

Callback closure for saving a model file.

Usage

cb.save.model(save_period = 0, save_name = "xgboost.model")

Arguments

save_period

save the model to disk after every save_period iterations; 0 means save the model at the end.

save_name

the name or path for the saved model file. It can contain a sprintf formatting specifier to include the integer iteration number in the file name. E.g., with save_name = 'xgboost_ the file saved at iteration 50 would be named "xgboost_0050.model".

Details

This callback function allows to save an xgb-model file, either periodically after each save_period's or at the end.

Callback function expects the following values to be set in its calling frame: bst, iteration, begin_iteration, end_iteration.

See Also


xgboost

Extreme Gradient Boosting

v1.4.1.1
Apache License (== 2.0) | file LICENSE
Authors
Tianqi Chen [aut], Tong He [aut, cre], Michael Benesty [aut], Vadim Khotilovich [aut], Yuan Tang [aut] (<https://orcid.org/0000-0001-5243-233X>), Hyunsu Cho [aut], Kailong Chen [aut], Rory Mitchell [aut], Ignacio Cano [aut], Tianyi Zhou [aut], Mu Li [aut], Junyuan Xie [aut], Min Lin [aut], Yifeng Geng [aut], Yutian Li [aut], XGBoost contributors [cph] (base XGBoost implementation)
Initial release
2021-04-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.