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

Function test_cv_query

catboost/python-package/ut/medium/test.py:3493–3509  ·  view source on GitHub ↗
(task_type, loss_function)

Source from the content-addressed store, hash-verified

3491 ids=['loss_function=' + val for val in ['QueryRMSE', 'YetiRank']]
3492)
3493def test_cv_query(task_type, loss_function):
3494 pool = Pool(QUERYWISE_TRAIN_FILE, column_description=QUERYWISE_CD_FILE)
3495 train_dir_prefix = test_output_path('')
3496
3497 computed_metric = {
3498 'QueryRMSE': 'QueryRMSE',
3499 'YetiRank': 'PFound'
3500 }[loss_function]
3501
3502 results = cv(
3503 pool,
3504 {"iterations": 20, "learning_rate": 0.03, "loss_function": loss_function, "task_type": task_type, "gpu_ram_part": TEST_GPU_RAM_PART,
3505 "train_dir": os.path.join(train_dir_prefix, 'catboost_info')},
3506 )
3507 assert f"test-{computed_metric}-mean" in results
3508
3509 return local_canonical_file(remove_time_from_json(os.path.join(train_dir_prefix, JSON_LOG_CV_PATH(0))))
3510
3511
3512def test_cv_pairs(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