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

Function test_compare

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

Source from the content-addressed store, hash-verified

6201
6202
6203def test_compare():
6204 dataset = np.array([[1, 4, 5, 6], [4, 5, 6, 7], [30, 40, 50, 60], [20, 15, 85, 60]])
6205 train_labels = [1.2, 3.4, 9.5, 24.5]
6206 model = CatBoostRegressor(learning_rate=1, depth=6, loss_function='RMSE', bootstrap_type='No')
6207 model.fit(dataset, train_labels)
6208 model2 = CatBoostRegressor(learning_rate=0.1, depth=1, loss_function='MAE', bootstrap_type='No')
6209 model2.fit(dataset, train_labels)
6210
6211 try:
6212 model.compare(model2, Pool(dataset, label=train_labels), ["RMSE"])
6213 except ImportError as ie:
6214 pytest.xfail(str(ie)) if str(ie) == "No module named widget" \
6215 else pytest.fail(str(ie))
6216
6217
6218def test_cv_fold_count_alias(task_type):

Callers

nothing calls this directly

Calls 7

fitMethod · 0.95
CatBoostRegressorClass · 0.90
PoolClass · 0.90
failMethod · 0.80
strClass · 0.50
arrayMethod · 0.45
compareMethod · 0.45

Tested by

no test coverage detected