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

Function test_cv_overfitting_detector

catboost/python-package/ut/medium/test.py:3653–3676  ·  view source on GitHub ↗
(with_metric_period, task_type)

Source from the content-addressed store, hash-verified

3651 ids=['with_metric_period=' + val for val in ['False', 'True']]
3652)
3653def test_cv_overfitting_detector(with_metric_period, task_type):
3654 pool = Pool(TRAIN_FILE, column_description=CD_FILE)
3655 train_dir_prefix = test_output_path('')
3656 results = cv(
3657 pool,
3658 {
3659 "iterations": 20,
3660 "learning_rate": 0.03,
3661 "loss_function": "Logloss",
3662 "eval_metric": "AUC",
3663 "task_type": task_type,
3664 "gpu_ram_part": TEST_GPU_RAM_PART,
3665 "train_dir": os.path.join(train_dir_prefix, 'catboost_info'),
3666 },
3667 metric_period=5 if with_metric_period else None,
3668 early_stopping_rounds=7,
3669 )
3670 assert "train-Logloss-mean" in results
3671
3672 prev_value = results["train-Logloss-mean"][0]
3673 for value in results["train-Logloss-mean"][1:-1]:
3674 assert value < prev_value
3675 prev_value = value
3676 return local_canonical_file(remove_time_from_json(os.path.join(train_dir_prefix, JSON_LOG_CV_PATH(0))))
3677
3678
3679@pytest.mark.parametrize('param_type', ['indices', 'strings'])

Callers

nothing calls this directly

Calls 7

PoolClass · 0.90
cvFunction · 0.90
test_output_pathFunction · 0.85
remove_time_from_jsonFunction · 0.85
JSON_LOG_CV_PATHFunction · 0.85
local_canonical_fileFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected