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

baseline

Description

The initial formula values for all input objects.

Possible types

  • list
  • numpy.ndarray
  • pandas.DataFrame
  • pandas.Series

Default value

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()