()
| 3006 | |
| 3007 | |
| 3008 | def test_generated_metrics(): |
| 3009 | # Test equivalence of the generated metric classes to string representations. |
| 3010 | train_pool = Pool(data=TRAIN_FILE, column_description=CD_FILE) |
| 3011 | test_pool = Pool(data=TEST_FILE, column_description=CD_FILE) |
| 3012 | |
| 3013 | model = CatBoostRegressor() |
| 3014 | model.fit(train_pool) |
| 3015 | eval_metrics = [metrics.Lq(q=3)] |
| 3016 | metrics_evals = model.eval_metrics(test_pool, eval_metrics) |
| 3017 | for metric in eval_metrics: |
| 3018 | assert str(metric) in metrics_evals |
| 3019 | |
| 3020 | # Test setting hints and default values. |
| 3021 | results = cv( |
| 3022 | train_pool, |
| 3023 | { |
| 3024 | 'iterations': 20, |
| 3025 | 'learning_rate': 0.03, |
| 3026 | 'loss_function': metrics.Logloss().set_hints(skip_train=True), |
| 3027 | 'eval_metric': metrics.AUC() |
| 3028 | }, |
| 3029 | ) |
| 3030 | for non_existing_field in ('train-Logloss-mean', 'train-Logloss-std', 'train-AUC-mean', 'train-AUC-std'): |
| 3031 | assert non_existing_field not in results |
| 3032 | |
| 3033 | |
| 3034 | def test_metrics_is_min_max_optimal(): |
nothing calls this directly
no test coverage detected