randomized_search
https://catboost.ai/en/docs/concepts/python-reference_catboostregressor_randomized_search#example
from catboost import CatBoostRegressor
train_data = [[1, 4, 5, 6],
[4, 5, 6, 7],
[30, 40, 50, 60],
[20, 30, 70, 60],
[10, 80, 40, 30],
[10, 10, 20, 30]]
train_labels = [10, 20, 30, 15, 10, 25]
model = CatBoostRegressor()
grid = {'learning_rate': [0.03, 0.1],
'depth': [4, 6, 10],
'l2_leaf_reg': [1, 3, 5, 7, 9]}
randomized_search_result = model.randomized_search(grid,
X=train_data,
y=train_labels,
plot=True)
grid_search
https://catboost.ai/en/docs/concepts/python-reference_catboostregressor_grid_search#example
from catboost import CatBoostRegressor
import numpy as np
train_data = np.random.randint(1, 100, size=(100, 10))
train_labels = np.random.randint(2, size=(100))
model = CatBoostRegressor()
grid = {'learning_rate': [0.03, 0.1],
'depth': [4, 6, 10],
'l2_leaf_reg': [1, 3, 5, 7, 9]}
grid_search_result = model.grid_search(grid,
X=train_data,
y=train_labels,
plot=True)
cb_model = CatBoostRegressor(iterations=700,
learning_rate=0.02,
depth=12,
eval_metric='RMSE',
random_seed = 23,
bagging_temperature = 0.2,
od_type='Iter',
metric_period = 75,
od_wait=100)