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

Function test_cv_pairs

catboost/python-package/ut/medium/test.py:3512–3533  ·  view source on GitHub ↗
(task_type)

Source from the content-addressed store, hash-verified

3510
3511
3512def test_cv_pairs(task_type):
3513 pool = Pool(QUERYWISE_TRAIN_FILE, column_description=QUERYWISE_CD_FILE, pairs=QUERYWISE_TRAIN_PAIRS_FILE)
3514 train_dir_prefix = test_output_path('')
3515 results = cv(
3516 pool,
3517 {
3518 "iterations": 20,
3519 "learning_rate": 0.03,
3520 "random_seed": 8,
3521 "loss_function": "PairLogit",
3522 "task_type": task_type,
3523 "gpu_ram_part": TEST_GPU_RAM_PART,
3524 "train_dir": os.path.join(train_dir_prefix, 'catboost_info')
3525 },
3526 )
3527 assert "train-PairLogit-mean" in results
3528
3529 prev_value = results["train-PairLogit-mean"][0]
3530 for value in results["train-PairLogit-mean"][1:]:
3531 assert value < prev_value
3532 prev_value = value
3533 return local_canonical_file(remove_time_from_json(os.path.join(train_dir_prefix, JSON_LOG_CV_PATH(0))))
3534
3535
3536def test_cv_pairs_generated(task_type):

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