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

Function cv

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

Cross-validate the CatBoost model. Parameters ---------- pool : catboost.Pool Data to cross-validate on. params : dict Parameters for CatBoost. CatBoost has many of parameters, all have default values. If None, all params still defaults.

(pool=None, params=None, dtrain=None, iterations=None, num_boost_round=None,
       fold_count=None, nfold=None, inverted=False, partition_random_seed=0, seed=None,
       shuffle=True, logging_level=None, stratified=None, as_pandas=True, metric_period=None,
       verbose=None, verbose_eval=None, plot=False, plot_file=None, early_stopping_rounds=None,
       save_snapshot=None, snapshot_file=None, snapshot_interval=None, metric_update_interval=0.5,
       folds=None, type='Classical', return_models=False, log_cout=None, log_cerr=None)

Source from the content-addressed store, hash-verified

7021
7022
7023def cv(pool=None, params=None, dtrain=None, iterations=None, num_boost_round=None,
7024 fold_count=None, nfold=None, inverted=False, partition_random_seed=0, seed=None,
7025 shuffle=True, logging_level=None, stratified=None, as_pandas=True, metric_period=None,
7026 verbose=None, verbose_eval=None, plot=False, plot_file=None, early_stopping_rounds=None,
7027 save_snapshot=None, snapshot_file=None, snapshot_interval=None, metric_update_interval=0.5,
7028 folds=None, type='Classical', return_models=False, log_cout=None, log_cerr=None):
7029 """
7030 Cross-validate the CatBoost model.
7031
7032 Parameters
7033 ----------
7034 pool : catboost.Pool
7035 Data to cross-validate on.
7036
7037 params : dict
7038 Parameters for CatBoost.
7039 CatBoost has many of parameters, all have default values.
7040 If None, all params still defaults.
7041 If dict, overriding some (or all) params.
7042
7043 dtrain : catboost.Pool or tuple (X, y)
7044 Synonym for pool parameter. Only one of these parameters should be set.
7045
7046 iterations : int
7047 Number of boosting iterations. Can be set in params dict.
7048
7049 num_boost_round : int
7050 Synonym for iterations. Only one of these parameters should be set.
7051
7052 fold_count : int, optional (default=3)
7053 The number of folds to split the dataset into.
7054
7055 nfold : int
7056 Synonym for fold_count.
7057
7058 type : string, optional (default='Classical')
7059 Type of cross-validation
7060 Possible values:
7061 - 'Classical'
7062 - 'Inverted'
7063 - 'TimeSeries'
7064
7065 inverted : bool, optional (default=False)
7066 Train on the test fold and evaluate the model on the training folds.
7067
7068 partition_random_seed : int, optional (default=0)
7069 Use this as the seed value for random permutation of the data.
7070 Permutation is performed before splitting the data for cross validation.
7071 Each seed generates unique data splits.
7072
7073 seed : int, optional
7074 Synonym for partition_random_seed. This parameter is deprecated. Use
7075 partition_random_seed instead.
7076 If both parameters are initialised partition_random_seed parameter is
7077 ignored.
7078
7079 shuffle : bool, optional (default=True)
7080 Shuffle the dataset objects before splitting into folds.

Callers 15

test_generated_metricsFunction · 0.90
test_cvFunction · 0.90
test_cv_queryFunction · 0.90
test_cv_pairsFunction · 0.90
test_cv_pairs_generatedFunction · 0.90
test_cv_custom_lossFunction · 0.90
test_cv_skip_trainFunction · 0.90
test_cv_metric_periodFunction · 0.90
test_cv_with_textFunction · 0.90

Calls 15

_process_synonymsFunction · 0.85
_process_verboseFunction · 0.85
anyFunction · 0.85
hasattrFunction · 0.85
lenFunction · 0.85
isinstanceFunction · 0.85
_get_features_indicesFunction · 0.85
_get_train_dirFunction · 0.85
create_dir_if_not_existFunction · 0.85
plot_wrapperFunction · 0.85
_convert_to_catboostFunction · 0.85

Tested by 15

test_generated_metricsFunction · 0.72
test_cvFunction · 0.72
test_cv_queryFunction · 0.72
test_cv_pairsFunction · 0.72
test_cv_pairs_generatedFunction · 0.72
test_cv_custom_lossFunction · 0.72
test_cv_skip_trainFunction · 0.72
test_cv_metric_periodFunction · 0.72
test_cv_with_textFunction · 0.72