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

Function test_model_comparison

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

Source from the content-addressed store, hash-verified

7599
7600
7601def test_model_comparison():
7602 def fit_model(iterations):
7603 pool = Pool(TRAIN_FILE, column_description=CD_FILE)
7604 model = CatBoostClassifier(iterations=iterations)
7605 model.fit(pool)
7606 return model
7607
7608 model0 = CatBoostClassifier()
7609 model1 = fit_model(42)
7610 model2 = fit_model(5)
7611
7612 # Test checks that model is fitted.
7613 with pytest.raises(CatBoostError):
7614 model1 == model0
7615
7616 with pytest.raises(CatBoostError):
7617 model0 == model1
7618
7619 # Trained model must not equal to object of other type.
7620 assert model1 != 42
7621 assert not (model1 == 'hello')
7622
7623 # Check identity.
7624 assert model1 == model1
7625 assert not (model1 != model1)
7626 assert model1 == model1.copy()
7627
7628 # Check equality to other model.
7629 assert not (model1 == model2)
7630 assert (model1 != model2)
7631
7632
7633def test_param_synonyms(task_type):

Callers

nothing calls this directly

Calls 3

CatBoostClassifierClass · 0.90
fit_modelFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected