diff --git a/docs/source/developer_guide/dependencies.rst b/docs/source/developer_guide/dependencies.rst index 86e9a924060..f70455b8e66 100644 --- a/docs/source/developer_guide/dependencies.rst +++ b/docs/source/developer_guide/dependencies.rst @@ -42,7 +42,7 @@ Estimators with a soft dependency need to ensure the following: or a ``list`` of ``str``, of import dependencies. Exceptions will automatically raised when constructing the estimator in an environment without the required packages. * In a case where the package import differs from the package name, i.e., ``import package_string`` is different from - ``pip install different-package-string`` (usually the case for packages containing a dash in the name), the ``python_dependecies_alias`` tag + ``pip install different-package-string`` (usually the case for packages containing a dash in the name), the ``python_dependencies_alias`` tag should be populated to pass the information on package and import strings as ``dict`` such as ``{"scikit-learn":"sklearn"}``. * If the soft dependencies require specific python versions, the ``python_version`` tag should also be populated, with a PEP 440 compliant version specification ``str`` such as ``"<3.10"`` or ``">3.6,~=3.8"``. diff --git a/sktime/alignment/dtw_python.py b/sktime/alignment/dtw_python.py index a43d07ea605..7bddbf580d2 100644 --- a/sktime/alignment/dtw_python.py +++ b/sktime/alignment/dtw_python.py @@ -51,7 +51,7 @@ class AlignerDTW(BaseAligner): "capability:distance": True, # does compute/return overall distance? "capability:distance-matrix": True, # does compute/return distance matrix? "python_dependencies": "dtw-python", - "python_dependecies_alias": {"dtw-python": "dtw"}, + "python_dependencies_alias": {"dtw-python": "dtw"}, } def __init__( diff --git a/sktime/base/_base.py b/sktime/base/_base.py index 22ebea82559..0546071fcd1 100644 --- a/sktime/base/_base.py +++ b/sktime/base/_base.py @@ -357,6 +357,9 @@ class BaseEstimator(BaseObject): Extends sktime's BaseObject to include basic functionality for fittable estimators. """ + # global dependency alias tag for sklearn dependency management + _tags = {"python_dependencies_alias": {"scikit-learn": "sklearn"}} + def __init__(self): self._is_fitted = False super().__init__() diff --git a/sktime/classification/distance_based/_elastic_ensemble.py b/sktime/classification/distance_based/_elastic_ensemble.py index 9c553c41511..4ff8eed4791 100644 --- a/sktime/classification/distance_based/_elastic_ensemble.py +++ b/sktime/classification/distance_based/_elastic_ensemble.py @@ -290,7 +290,7 @@ def _fit(self, X, y): param_distributions=ElasticEnsemble._get_100_param_options( self.distance_measures[dm], X ), - n_iter=100 * self.proportion_of_param_options, + n_iter=int(100 * self.proportion_of_param_options), cv=LeaveOneOut(), scoring="accuracy", n_jobs=self._threads_to_use, diff --git a/sktime/classification/feature_based/_matrix_profile_classifier.py b/sktime/classification/feature_based/_matrix_profile_classifier.py index bb32e24802b..448720cd470 100644 --- a/sktime/classification/feature_based/_matrix_profile_classifier.py +++ b/sktime/classification/feature_based/_matrix_profile_classifier.py @@ -57,17 +57,20 @@ class MatrixProfileClassifier(BaseClassifier): >>> from sktime.classification.feature_based import MatrixProfileClassifier >>> from sktime.datasets import load_unit_test >>> X_train, y_train = load_unit_test(split="train", return_X_y=True) - >>> X_test, y_test = load_unit_test(split="test", return_X_y=True) - >>> clf = MatrixProfileClassifier() - >>> clf.fit(X_train, y_train) - MatrixProfileClassifier(...) - >>> y_pred = clf.predict(X_test) + >>> X_test, y_test = load_unit_test(split="test", return_X_y=True) # doctest: +SKIP + >>> clf = MatrixProfileClassifier() # doctest: +SKIP + >>> clf.fit(X_train, y_train) # doctest: +SKIP + MatrixProfileClassifier(...) # doctest: +SKIP + >>> y_pred = clf.predict(X_test) # doctest: +SKIP """ _tags = { "capability:multithreading": True, "capability:predict_proba": True, "classifier_type": "distance", + # sklearn 1.3.0 has a bug which causes predict_proba to fail + # see scikit-learn#26768 and sktime#4778 + "python_dependencies": "scikit-learn!=1.3.0", } def __init__(