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

Function test_save_model

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

Source from the content-addressed store, hash-verified

1884
1885
1886def test_save_model(task_type):
1887 train_pool = Pool(TRAIN_FILE, column_description=CD_FILE)
1888 test_pool = Pool(TEST_FILE, column_description=CD_FILE)
1889 model = CatBoost({'task_type': task_type, 'gpu_ram_part': TEST_GPU_RAM_PART, 'devices': '0'})
1890 model.fit(train_pool)
1891 output_model_path = test_output_path(OUTPUT_MODEL_PATH)
1892 model.save_model(output_model_path)
1893 model2 = CatBoost()
1894 model2.load_model(output_model_path)
1895 pred1 = model.predict(test_pool)
1896 pred2 = model2.predict(test_pool)
1897 assert _check_data(pred1, pred2)
1898
1899
1900def test_multiclass(task_type):

Callers

nothing calls this directly

Calls 8

fitMethod · 0.95
save_modelMethod · 0.95
load_modelMethod · 0.95
predictMethod · 0.95
PoolClass · 0.90
CatBoostClass · 0.90
test_output_pathFunction · 0.85
_check_dataFunction · 0.70

Tested by

no test coverage detected