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 after_iteration(self, info: SimpleNamespace) -> bool:
      if info.iteration % self.metric_period == 0:
          for data, metric in info.metrics.items():
              for metric_name, log in metric.items():
                  # todo: replace with wandb.run._log once available
                  wandb.log(
                      {f"{data}-{metric_name}": log[-1]}, commit=False
                  )
          # todo: replace with wandb.run._log once available
          wandb.log(
              {
                  f"iteration@metric-period-{self.metric_period}": info.iteration
              }
          )
  
      return True
  
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 2 for calling the WandbCallback obj's underlying member method code with example usage: obj.after_iteration(info) and returns: True