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

Function test_fit_predict_baseline

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

Source from the content-addressed store, hash-verified

2395
2396
2397def test_fit_predict_baseline(task_type):
2398 train_pool = Pool(TRAIN_FILE, column_description=CD_FILE)
2399 train_pool.set_baseline(np.arange(1, train_pool.num_row() + 1))
2400 test_pool = Pool(TEST_FILE, column_description=CD_FILE)
2401 test_baseline = np.arange(0, test_pool.num_row())
2402 test_pool.set_baseline(test_baseline)
2403 test_pool_without_baseline = Pool(TEST_FILE, column_description=CD_FILE)
2404 model = CatBoostRegressor(iterations=100, learning_rate=0.03, task_type=task_type, gpu_ram_part=TEST_GPU_RAM_PART, devices='0')
2405 model.fit(train_pool)
2406 pred = model.predict(test_pool)
2407 pred_no_baseline = model.predict(test_pool_without_baseline)
2408 preds_path = test_output_path(PREDS_PATH)
2409 assert np.allclose(pred, pred_no_baseline + test_baseline)
2410 np.save(preds_path, np.array(pred))
2411 return local_canonical_file(preds_path)
2412
2413
2414def test_ntree_limit(task_type):

Callers

nothing calls this directly

Calls 9

set_baselineMethod · 0.95
fitMethod · 0.95
predictMethod · 0.95
PoolClass · 0.90
CatBoostRegressorClass · 0.90
test_output_pathFunction · 0.85
local_canonical_fileFunction · 0.50
saveMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected