class_docstr: `WandbCallback` automatically integrates CatBoost with wandb.
  
  Arguments:
      - metric_period: (int) if you are passing `metric_period` to your CatBoost model please pass the same value here (default=1).
  
  Passing `WandbCallback` to CatBoost will:
  - log training and validation metrics at every `metric_period`
  - log iteration at every `metric_period`
  
  Example:
      ```
      train_pool = Pool(train[features], label=train["label"], cat_features=cat_features)
      test_pool = Pool(test[features], label=test["label"], cat_features=cat_features)
  
      model = CatBoostRegressor(
          iterations=100,
          loss_function="Cox",
          eval_metric="Cox",
      )
  
      model.fit(
          train_pool,
          eval_set=test_pool,
          callbacks=[WandbCallback()],
      )
      ```
class_docstr_tok: ["`","WandbCallback","`","automatically","integrates","CatBoost","with","wandb",".","Arguments",":","-","metric_period",":","(","int",")","if","you","are","passing","`","metric_period","`","to","your","CatBoost","model","please","pass","the","same","value","here","(","default=1",")",".","Passing","`","WandbCallback","`","to","CatBoost","will",":","-","log","training","and","validation","metrics","at","every","`","metric_period","`","-","log","iteration","at","every","`","metric_period","`","Example",":","``","`","train_pool","=","Pool","(","train","[","features","]",",","label=train","[","``","label","''","]",",","cat_features=cat_features",")","test_pool","=","Pool","(","test","[","features","]",",","label=test","[","``","label","''","]",",","cat_features=cat_features",")","model","=","CatBoostRegressor","(","iterations=100",",","loss_function=","''","Cox","''",",","eval_metric=","''","Cox","''",",",")","model.fit","(","train_pool",",","eval_set=test_pool",",","callbacks=","[","WandbCallback","(",")","]",",",")","``","`"]
code: def __init__(self, metric_period: int = 1):
      if wandb.run is None:
          raise wandb.Error(
              "You must call `wandb.init()` before `WandbCallback()`"
          )
  
      with wb_telemetry.context() as tel:
          tel.feature.catboost_wandb_callback = True
  
      self.metric_period: int = metric_period
  
file_path: wandb/wandb/integration/catboost/catboost.py
imports: from pathlib import Path
  from types import SimpleNamespace
  from typing import List, Union
  from catboost import CatBoostClassifier, CatBoostRegressor
  import wandb
  from wandb.sdk.lib import telemetry
label_desc: Use image node_id 1 to create a new WandbCallback object  with example: obj = WandbCallback(metric_period)