set_baseline

Set initial formula values for all input objects. The training starts from these values for all input objects instead of starting from zero.

Method call format

set_baseline(baseline)

Parameters

Parameter Possible types Description Default value
baseline
  • list
  • numpy.ndarray
  • pandas.DataFrame
  • pandas.Series

The initial formula values for all input objects.

Required parameter
Parameter Possible types Description Default value
baseline
  • list
  • numpy.ndarray
  • pandas.DataFrame
  • pandas.Series

The initial formula values for all input objects.

Required parameter

Example

import numpy as np
from catboost import Pool

train_data = [[76, 'blvd', 41, 50, 7],
              [75, 'today', 57, 0, 48],
              [70, 'letters', 33, 17, 7],
              [72, 'now', 43, 29, 12],
              [60, 'back', 2, 0, 1]]

label_values = [1, 0, 0, 1, 4]

input_pool = Pool(data = train_data,
                  label = label_values,
                  cat_features = [1])

input_pool.set_baseline([1, 3, 2, 1, 2])

input_pool.get_baseline()