MCPcopy Create free account
hub / github.com/catboost/catboost / train

Function train

catboost/python-package/catboost/core.py:6713–6841  ·  view source on GitHub ↗

Train CatBoost model. Parameters ---------- params : dict Parameters for CatBoost. If None, all params are set to their defaults. If dict, overriding parameters present in the dict. pool : catboost.Pool or tuple (X, y) Data to train on. i

(pool=None, params=None, dtrain=None, logging_level=None, verbose=None, iterations=None,
          num_boost_round=None, evals=None, eval_set=None, plot=None, plot_file=None, verbose_eval=None, metric_period=None,
          early_stopping_rounds=None, save_snapshot=None, snapshot_file=None, snapshot_interval=None,
          init_model=None, log_cout=None, log_cerr=None)

Source from the content-addressed store, hash-verified

6711
6712
6713def train(pool=None, params=None, dtrain=None, logging_level=None, verbose=None, iterations=None,
6714 num_boost_round=None, evals=None, eval_set=None, plot=None, plot_file=None, verbose_eval=None, metric_period=None,
6715 early_stopping_rounds=None, save_snapshot=None, snapshot_file=None, snapshot_interval=None,
6716 init_model=None, log_cout=None, log_cerr=None):
6717 """
6718 Train CatBoost model.
6719
6720 Parameters
6721 ----------
6722 params : dict
6723 Parameters for CatBoost.
6724 If None, all params are set to their defaults.
6725 If dict, overriding parameters present in the dict.
6726
6727 pool : catboost.Pool or tuple (X, y)
6728 Data to train on.
6729
6730 iterations : int
6731 Number of boosting iterations. Can be set in params dict.
6732
6733 evals : catboost.Pool or list of catboost.Pool or tuple (X, y) or list [(X, y)]
6734 Synonym for eval_set. Only one of these parameters should be set.
6735
6736 dtrain : catboost.Pool or tuple (X, y)
6737 Synonym for pool parameter. Only one of these parameters should be set.
6738
6739 logging_level : string, optional (default=None)
6740 Possible values:
6741 - 'Silent'
6742 - 'Verbose'
6743 - 'Info'
6744 - 'Debug'
6745
6746 metric_period : int
6747 Frequency of evaluating metrics.
6748
6749 verbose : bool or int
6750 If verbose is bool, then if set to True, logging_level is set to Verbose,
6751 if set to False, logging_level is set to Silent.
6752 If verbose is int, it determines the frequency of writing metrics to output and
6753 logging_level is set to Verbose.
6754
6755 verbose_eval : bool or int
6756 Synonym for verbose. Only one of these parameters should be set.
6757
6758 iterations : int
6759 Number of boosting iterations. Can be set in params dict.
6760
6761 num_boost_round : int
6762 Synonym for iterations. Only one of these parameters should be set.
6763
6764 eval_set : catboost.Pool or list of catboost.Pool or tuple (X, y) or list [(X, y)]
6765 Validation dataset or datasets for metrics calculation and possibly early stopping.
6766
6767 plot : bool, optional (default=False)
6768 If True, draw train and eval error in Jupyter notebook
6769`
6770 plot_file : file-like or str, optional (default=None)

Callers 7

test_verbose_intFunction · 0.90
test_shap_complex_ctrFunction · 0.90
test_silentFunction · 0.90
test_shap_assertFunction · 0.90

Calls 4

fitMethod · 0.95
CatBoostClass · 0.85
CatBoostErrorClass · 0.50
updateMethod · 0.45

Tested by 7

test_verbose_intFunction · 0.72
test_shap_complex_ctrFunction · 0.72
test_silentFunction · 0.72
test_shap_assertFunction · 0.72