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

Function test_metadata

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

Source from the content-addressed store, hash-verified

5369
5370
5371def test_metadata():
5372 train_pool = Pool(TRAIN_FILE, column_description=CD_FILE)
5373 model = CatBoostClassifier(
5374 iterations=2,
5375 learning_rate=0.03,
5376 loss_function='Logloss',
5377 metadata={"type": "AAA", "postprocess": "BBB"}
5378 )
5379 model.fit(train_pool)
5380 output_model_path = test_output_path(OUTPUT_MODEL_PATH)
5381 model.save_model(output_model_path)
5382
5383 model2 = CatBoost()
5384 model2.load_model(output_model_path)
5385 assert 'type' in model2.get_metadata()
5386 assert model2.get_metadata()['type'] == 'AAA'
5387 assert 'postprocess' in model2.get_metadata()
5388 assert model2.get_metadata()['postprocess'] == 'BBB'
5389 return compare_canonical_models(output_model_path)
5390
5391
5392@pytest.mark.parametrize('metric', ['Logloss', 'RMSE', 'PRAUC'])

Callers

nothing calls this directly

Calls 9

fitMethod · 0.95
load_modelMethod · 0.95
PoolClass · 0.90
CatBoostClassifierClass · 0.90
CatBoostClass · 0.90
test_output_pathFunction · 0.85
compare_canonical_modelsFunction · 0.85
save_modelMethod · 0.80
get_metadataMethod · 0.80

Tested by

no test coverage detected