snowflake.ml.experiment.callback.xgboost.SnowflakeXgboostCallback¶
- class snowflake.ml.experiment.callback.xgboost.SnowflakeXgboostCallback(*args: Any, **kwargs: Any)¶
Bases:
TrainingCallbackXGBoost callback for automatically logging to a Snowflake ML Experiment.
Initialize the callback.
- Parameters:
experiment_tracking (ExperimentTracking) – The Experiment Tracking instance to use for logging.
log_model (bool) – Whether to log the model at the end of training. Default is True.
log_metrics (bool) – Whether to log metrics during training. Default is True.
log_params (bool) – Whether to log model parameters at the start of training. Default is True.
log_every_n_epochs (int) – Frequency with which to log metrics. Must be positive. Default is 1, logging after every iteration.
model_name (Optional[str]) – The model name to use when logging the model. If None, the model name will be derived from the experiment name.
version_name (Optional[str]) – The model version name to use when logging the model. If None, the version name will be randomly generated.
model_signature (Optional[ModelSignature]) – The model signature to use when logging the model. This is required if
log_modelis set to True.
- Raises:
ValueError – When
log_every_n_epochsis not a positive integer.
Methods
- after_iteration(model: Any, epoch: int, evals_log: dict[str, dict[str, Any]]) bool¶
- after_training(model: xgboost.Booster) xgboost.Booster¶
- before_training(model: xgboost.Booster) xgboost.Booster¶