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

Function test_multiclass

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

Source from the content-addressed store, hash-verified

1898
1899
1900def test_multiclass(task_type):
1901 pool = Pool(CLOUDNESS_TRAIN_FILE, column_description=CLOUDNESS_CD_FILE)
1902 classifier = CatBoostClassifier(iterations=2, loss_function='MultiClass', thread_count=8, task_type=task_type, gpu_ram_part=TEST_GPU_RAM_PART, devices='0')
1903 classifier.fit(pool)
1904 output_model_path = test_output_path(OUTPUT_MODEL_PATH)
1905 classifier.save_model(output_model_path)
1906 new_classifier = CatBoostClassifier()
1907 new_classifier.load_model(output_model_path)
1908 pred = new_classifier.predict_proba(pool)
1909 preds_path = test_output_path(PREDS_PATH)
1910 np.save(preds_path, np.round(np.array(pred)), 9)
1911 return local_canonical_file(preds_path)
1912
1913
1914@pytest.mark.parametrize('missed_classes', [False, True], ids=['missed_classes=False', 'missed_classes=True'])

Callers

nothing calls this directly

Calls 10

fitMethod · 0.95
predict_probaMethod · 0.95
PoolClass · 0.90
CatBoostClassifierClass · 0.90
test_output_pathFunction · 0.85
save_modelMethod · 0.80
load_modelMethod · 0.80
local_canonical_fileFunction · 0.50
saveMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected