__author__ = ["Sebastiaan Koel"] __all__ = [] import pytest import pandas as pd from sktime.datasets import load_uschange _CHECKS = { 'uschange': { 'columns': ['Income', 'Production', 'Savings', 'Unemployment'], 'len_y': 187, 'len_X': 187, 'data_types_X': {'Income': 'float64', 'Production': 'float64', 'Savings': 'float64', 'Unemployment': 'float64'}, 'data_type_y': 'float64', 'data': load_uschange() }, } @pytest.mark.parametrize("dataset", sorted(_CHECKS.keys())) def test_data_loaders(dataset): """ asserts if datasets are loaded correctly ---------- dataset: dictionary with values to assert against should contain: 'columns' : list with column names in correct order, 'len_y' : lenght of the y series (int), 'len_X' : lenght of the X series/dataframe (int), 'data_types_X' : dictionary with column name keys and dtype as value, 'data_type_y' : dtype if y column (string)
from sktime.datasets import load_uschange from sktime.utils._testing.estimator_checks import _assert_array_almost_equal _CHECKS = { "uschange": { "columns": ["Income", "Production", "Savings", "Unemployment"], "len_y": 187, "len_X": 187, "data_types_X": { "Income": "float64", "Production": "float64", "Savings": "float64", "Unemployment": "float64", }, "data_type_y": "float64", "data": load_uschange(), }, } @pytest.mark.parametrize("dataset", sorted(_CHECKS.keys())) def test_data_loaders(dataset): """ asserts if datasets are loaded correctly ---------- dataset: dictionary with values to assert against should contain: 'columns' : list with column names in correct order, 'len_y' : lenght of the y series (int), 'len_X' : lenght of the X series/dataframe (int), 'data_types_X' : dictionary with column name keys and dtype as value, 'data_type_y' : dtype if y column (string)