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

Function test_grow_policy_fails

catboost/python-package/ut/medium/test.py:7681–7708  ·  view source on GitHub ↗
(task_type, grow_policy)

Source from the content-addressed store, hash-verified

7679
7680@pytest.mark.parametrize('grow_policy', NONSYMMETRIC)
7681def test_grow_policy_fails(task_type, grow_policy):
7682 train_pool = Pool(TRAIN_FILE, column_description=CD_FILE)
7683 test_pool = Pool(TEST_FILE, column_description=CD_FILE)
7684 args = {
7685 'iterations': 30,
7686 'loss_function': 'Logloss',
7687 'use_best_model': False,
7688 'learning_rate': 0.3,
7689 'grow_policy': grow_policy,
7690 'boosting_type': 'Plain',
7691 'task_type': task_type,
7692 'gpu_ram_part': TEST_GPU_RAM_PART,
7693 'devices': '0'
7694 }
7695 model = CatBoostClassifier(**args)
7696
7697 model.fit(train_pool)
7698
7699 with pytest.raises(CatBoostError):
7700 model.shrink(9)
7701 with pytest.raises(CatBoostError):
7702 model.get_object_importance(test_pool, train_pool)
7703
7704 model_output = test_output_path('model')
7705 for format in ['AppleCoreML', 'cpp', 'python', 'onnx']:
7706 with pytest.raises(CatBoostError):
7707 model.save_model(model_output, format=format)
7708 _ = sum_models([model, model.copy()])
7709
7710
7711@pytest.mark.parametrize('grow_policy', NONSYMMETRIC)

Callers

nothing calls this directly

Calls 9

fitMethod · 0.95
PoolClass · 0.90
CatBoostClassifierClass · 0.90
sum_modelsFunction · 0.90
test_output_pathFunction · 0.85
get_object_importanceMethod · 0.80
save_modelMethod · 0.80
shrinkMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected