| 6201 | |
| 6202 | |
| 6203 | def 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 | |
| 6218 | def test_cv_fold_count_alias(task_type): |