Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry lookup - all_estimators refactor, and new all_tags #1196

Merged
merged 9 commits into from
Jul 26, 2021
Merged
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def find_source():
def _make_estimator_overview(app):
"""Make estimator overview table."""
import pandas as pd
from sktime.utils import all_estimators
from sktime.registry import all_estimators

def _process_author_info(author_info):
"""
Expand Down
4 changes: 2 additions & 2 deletions examples/01_forecasting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@
"metadata": {},
"outputs": [],
"source": [
"from sktime.utils import all_estimators"
"from sktime.registry import all_estimators"
]
},
{
Expand All @@ -1360,7 +1360,7 @@
"outputs": [],
"source": [
"# all_estimators returns list of pairs - data frame conversion for pretty printing\n",
"pd.DataFrame(all_estimators(\"forecaster\"), columns=[\"name\", \"class\"])"
"all_estimators(\"forecaster\", as_dataframe=True)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/02_classification_univariate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1458,9 +1458,9 @@
}
],
"source": [
"from sktime.utils import all_estimators\n",
"from sktime.registry import all_estimators\n",
"\n",
"all_estimators(estimator_types=\"classifier\")"
"all_estimators(estimator_types=\"classifier\", as_dataframe=True)"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion sktime/annotation/tests/test_all_annotators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest
from sktime.utils._testing.estimator_checks import _construct_instance, _make_args
from sktime.utils import all_estimators
from sktime.registry import all_estimators

ALL_ANNOTATORS = all_estimators(estimator_types="series-annotator", return_names=False)

Expand Down
2 changes: 1 addition & 1 deletion sktime/dists_kernels/tests/test_all_dist_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import pytest

from sktime.utils import all_estimators
from sktime.registry import all_estimators
from sktime.utils._testing.panel import make_transformer_problem
from sktime.tests._config import ESTIMATOR_TEST_PARAMS

Expand Down
2 changes: 1 addition & 1 deletion sktime/dists_kernels/tests/test_compose_tab_to_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from sktime.dists_kernels.compose_tab_to_panel import AggrDist
from sktime.dists_kernels.scipy_dist import ScipyDist
from sktime.utils._testing.panel import make_transformer_problem
from sktime.utils import all_estimators
from sktime.registry import all_estimators

PAIRWISE_TRANSFORMERS_TAB = all_estimators(
estimator_types="transformer-pairwise", return_names=False
Expand Down
2 changes: 1 addition & 1 deletion sktime/forecasting/tests/test_all_forecasters.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from sktime.performance_metrics.forecasting import (
mean_absolute_percentage_error,
)
from sktime.utils import all_estimators
from sktime.registry import all_estimators
from sktime.utils._testing.estimator_checks import _construct_instance
from sktime.utils._testing.forecasting import _assert_correct_pred_time_index
from sktime.utils._testing.forecasting import _get_expected_index_for_update_predict
Expand Down
2 changes: 1 addition & 1 deletion sktime/forecasting/tests/test_sktime_forecasters.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from sktime.forecasting.base import BaseForecaster
from sktime.forecasting.base._sktime import _BaseWindowForecaster
from sktime.forecasting.model_selection import temporal_train_test_split
from sktime.utils import all_estimators
from sktime.registry import all_estimators
from sktime.utils._testing.estimator_checks import _construct_instance
from sktime.utils._testing.forecasting import make_forecasting_problem

Expand Down
14 changes: 13 additions & 1 deletion sktime/registry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# -*- coding: utf-8 -*-
"""Sktime registry module exports."""

from sktime.registry._tags import (
ESTIMATOR_TAG_REGISTER,
ESTIMATOR_TAG_LIST,
check_tag_is_valid,
)

from sktime.registry._tags import ESTIMATOR_TAG_REGISTER, ESTIMATOR_TAG_LIST
from sktime.registry._base_classes import (
BASE_CLASS_REGISTER,
BASE_CLASS_LIST,
Expand All @@ -12,7 +18,13 @@
TRANSFORMER_MIXIN_SCITYPE_LIST,
)

from sktime.registry._lookup import all_estimators, all_tags


__all__ = [
"all_estimators",
"all_tags",
"check_tag_is_valid",
"ESTIMATOR_TAG_LIST",
"ESTIMATOR_TAG_REGISTER",
"BASE_CLASS_REGISTER",
Expand Down