peacock-data-public-datasets-idc-cronscript
/
venv
/lib
/python3.10
/site-packages
/sklearn
/utils
/tests
/test_plotting.py
import numpy as np | |
import pytest | |
from sklearn.utils._plotting import _interval_max_min_ratio, _validate_score_name | |
def metric(): | |
pass # pragma: no cover | |
def neg_metric(): | |
pass # pragma: no cover | |
def test_validate_score_name(score_name, scoring, negate_score, expected_score_name): | |
"""Check that we return the right score name.""" | |
assert ( | |
_validate_score_name(score_name, scoring, negate_score) == expected_score_name | |
) | |
# In the following test, we check the value of the max to min ratio | |
# for parameter value intervals to check that using a decision threshold | |
# of 5. is a good heuristic to decide between linear and log scales on | |
# common ranges of parameter values. | |
def test_inverval_max_min_ratio(data, lower_bound, upper_bound): | |
assert lower_bound < _interval_max_min_ratio(data) < upper_bound | |