Problem: I'm trying to change the number of iterations after I load the model weights but this not changing anything
catboost version: 0.17
Operating System: ubuntu 18.04
Code:
model = CatBoostRegressor()
model.load_model('boost.cbm')
model = model.set_params(iterations=10)
print(model.get_all_params())
Output:
{'nan_mode': 'Min',
'eval_metric': 'RMSE',
'combinations_ctr': ['Borders:CtrBorderCount=15:CtrBorderType=Uniform:TargetBorderCount=1:TargetBorderType=MinEntropy:Prior=0/1:Prior=0.5/1:Prior=1/1',
'Counter:CtrBorderCount=15:CtrBorderType=Uniform:Prior=0/1'],
'iterations': 300,
'sampling_frequency': 'PerTree',
'fold_permutation_block': 0,
'leaf_estimation_method': 'Gradient',
'counter_calc_method': 'SkipTest',
'boosting_type': 'Plain',
'feature_border_type': 'GreedyLogSum',
'ctr_leaf_count_limit': 18446744073709551615,
'bayesian_matrix_reg': 0.1000000015,
'one_hot_max_size': 2,
'l2_leaf_reg': 9,
'random_strength': 1,
'rsm': 1,
'boost_from_average': True,
'max_ctr_complexity': 4,
'model_size_reg': 0.5,
'approx_on_full_history': False,
'simple_ctr': ['Borders:CtrBorderCount=15:CtrBorderType=Uniform:TargetBorderCount=1:TargetBorderType=MinEntropy:Prior=0/1:Prior=0.5/1:Prior=1/1',
'Counter:CtrBorderCount=15:CtrBorderType=Uniform:Prior=0/1'],
'use_best_model': True,
'random_seed': 42,
'depth': 7,
'ctr_target_border_count': 1,
'has_time': False,
'store_all_simple_ctr': False,
'fold_len_multiplier': 2,
'border_count': 254,
'bagging_temperature': 1,
'classes_count': 0,
'sparse_features_conflict_fraction': 0,
'leaf_estimation_backtracking': 'AnyImprovement',
'best_model_min_trees': 1,
'model_shrink_rate': 0,
'loss_function': 'MAE',
'learning_rate': 0.1000000015,
'score_function': 'Cosine',
'task_type': 'CPU',
'leaf_estimation_iterations': 1,
'bootstrap_type': 'Bayesian',
'permutation_count': 4}
We'll deprecate using set_param and set_params on a trained model, because some parameters are set dependant on the dataset, and it is not obvious for a user, if this parameters will be reused in a new model or reset one more time using the new dataset. So this operation will give you an error in one of the next releases.
Thanks a lot for pointing out this inconsistency!
The fix is on github now and will be out on pypi in the next release this week.
@annaveronika Thanks a lot!
Most helpful comment
The fix is on github now and will be out on pypi in the next release this week.