(task_type)
| 2395 | |
| 2396 | |
| 2397 | def 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 | |
| 2414 | def test_ntree_limit(task_type): |
nothing calls this directly
no test coverage detected