()
| 7599 | |
| 7600 | |
| 7601 | def 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 | |
| 7633 | def test_param_synonyms(task_type): |
nothing calls this directly
no test coverage detected