diff --git a/aeon/datatypes/_adapter/dask_to_pd.py b/aeon/datatypes/_adapter/dask_to_pd.py index 1b9bd7fc2b..6c69c8ab30 100644 --- a/aeon/datatypes/_adapter/dask_to_pd.py +++ b/aeon/datatypes/_adapter/dask_to_pd.py @@ -204,7 +204,6 @@ def ret(valid, msg, metadata, return_metadata): # check whether index is equally spaced or if there are any nans # compute only if needed if return_metadata: - # todo: logic for equal spacing metadata["is_equally_spaced"] = True metadata["has_nans"] = obj.isnull().values.any().compute() diff --git a/aeon/datatypes/_panel/_check.py b/aeon/datatypes/_panel/_check.py index a02f07dcd2..d7812a5e5a 100644 --- a/aeon/datatypes/_panel/_check.py +++ b/aeon/datatypes/_panel/_check.py @@ -428,7 +428,6 @@ def is_nested_dataframe(obj, return_metadata=False, var_name="obj"): metadata["has_nans"] = _nested_dataframe_has_nans(obj) metadata["is_equal_length"] = not _nested_dataframe_has_unequal(obj) - # todo: this is temporary override, proper is_empty logic needs to be added metadata["is_empty"] = False metadata["is_equally_spaced"] = True # end hacks diff --git a/aeon/datatypes/_proba/_convert.py b/aeon/datatypes/_proba/_convert.py index 954504a721..b9b2946631 100644 --- a/aeon/datatypes/_proba/_convert.py +++ b/aeon/datatypes/_proba/_convert.py @@ -86,7 +86,6 @@ def convert_pred_interval_to_quantiles(y_pred, inplace=False): var_names = idx.get_level_values(0) # treat univariate default name - # todo: maybe not a good idea, remove this... # here because it's in the current specification var_names = ["Quantiles" if x == "Coverage" else x for x in var_names] @@ -153,7 +152,6 @@ def convert_pred_quantiles_to_interval(y_pred, inplace=False): var_names = idx.get_level_values(0) # treat univariate default name - # todo: maybe not a good idea, remove this... # here because it's in the current specification var_names = ["Coverage" if x == "Quantiles" else x for x in var_names] diff --git a/aeon/datatypes/tests/test_check.py b/aeon/datatypes/tests/test_check.py index 57cf9bb059..ae84f6cf30 100644 --- a/aeon/datatypes/tests/test_check.py +++ b/aeon/datatypes/tests/test_check.py @@ -111,8 +111,6 @@ def test_check_positive(scitype, mtype, fixture_index): """ # retrieve fixture for checking fixture = get_examples(mtype=mtype, as_scitype=scitype).get(fixture_index) - - # todo: possibly remove this once all checks are defined check_is_defined = (mtype, scitype) in check_dict.keys() # check fixtures that exist against checks that exist @@ -147,7 +145,6 @@ def test_check_metadata_inference(scitype, mtype, fixture_index): mtype=mtype, as_scitype=scitype, return_metadata=True ).get(fixture_index) - # todo: possibly remove this once all checks are defined check_is_defined = (mtype, scitype) in check_dict.keys() # if the examples have no metadata to them, don't test metadata_provided = expected_metadata is not None @@ -203,7 +200,6 @@ def test_check_negative(scitype, mtype): # retrieve fixture for checking fixture_wrong_type = fixtures[wrong_mtype].get(i) - # todo: possibly remove this once all checks are defined check_is_defined = (mtype, scitype) in check_dict.keys() # check fixtures that exist against checks that exist @@ -231,8 +227,6 @@ def test_mtype_infer(scitype, mtype, fixture_index): """ # retrieve fixture for checking fixture = get_examples(mtype=mtype, as_scitype=scitype).get(fixture_index) - - # todo: possibly remove this once all checks are defined check_is_defined = (mtype, scitype) in check_dict.keys() # check fixtures that exist against checks that exist @@ -269,8 +263,6 @@ def test_scitype_infer(scitype, mtype, fixture_index): # retrieve fixture for checking fixture = get_examples(mtype=mtype, as_scitype=scitype).get(fixture_index) - - # todo: possibly remove this once all checks are defined check_is_defined = (mtype, scitype) in check_dict.keys() # check fixtures that exist against checks that exist diff --git a/aeon/forecasting/ardl.py b/aeon/forecasting/ardl.py index 35ab5223ef..b40c68bb0e 100644 --- a/aeon/forecasting/ardl.py +++ b/aeon/forecasting/ardl.py @@ -290,7 +290,6 @@ def check_param_validity(self, X): ) return inner_order, inner_auto_ardl - # todo: implement this, mandatory def _fit(self, y, X=None, fh=None): """Fit forecaster to training data. @@ -468,8 +467,6 @@ def _update(self, y, X=None, update_params=True): mtype_last_seen = self._y_mtype_last_seen # refit with updated data, not only passed data self.fit(y=self._y, X=self._X, fh=self._fh) - # todo: should probably be self._fit, not self.fit - # but looping to self.fit for now to avoid interface break self._y_mtype_last_seen = mtype_last_seen # if update_params=False, and there are no components, do nothing diff --git a/aeon/forecasting/base/_base.py b/aeon/forecasting/base/_base.py index 8ae07ab35f..165545e799 100644 --- a/aeon/forecasting/base/_base.py +++ b/aeon/forecasting/base/_base.py @@ -1421,7 +1421,6 @@ def _check_missing(metadata, obj_name): if X is not None and y is not None: if self.get_tag("X-y-must-have-same-index"): # currently, check_equal_time_index only works for Series - # todo: fix this so the check is general, using get_time_index if not self.get_tag("ignores-exogeneous-X") and X_scitype == "Series": check_equal_time_index(X, y, mode="contains") @@ -1429,10 +1428,6 @@ def _check_missing(metadata, obj_name): raise TypeError("X and y must have the same scitype") # end compatibility checking X and y - # todo: add tests that : - # y_inner_scitype are same as X_inner_scitype - # y_inner_scitype always includes "less index" scitypes - # convert X & y to supported inner type, if necessary ##################################################### @@ -1886,7 +1881,6 @@ def _update(self, y, X=None, update_params=True): _converter_store_y = self._converter_store_y # refit with updated data, not only passed data self.fit(y=self._y, X=self._X, fh=self._fh) - # todo: should probably be self._fit, not self.fit # but looping to self.fit for now to avoid interface break self._y_mtype_last_seen = mtype_last_seen self._converter_store_y = _converter_store_y @@ -2125,7 +2119,6 @@ def _predict_var(self, fh=None, X=None, cov=False): ) if implements_proba: - # todo: this works only univariate now, need to implement multivariate pred_var = self._predict_proba(fh=fh, X=X) pred_var = pd.DataFrame(pred_var) @@ -2165,8 +2158,6 @@ def _predict_var(self, fh=None, X=None, cov=False): return pred_var - # todo: does not work properly for multivariate or hierarchical - # still need to implement this - once interface is consolidated def _predict_proba(self, fh, X, marginal=True): """Compute/return fully probabilistic forecasts. diff --git a/aeon/forecasting/base/_fh.py b/aeon/forecasting/base/_fh.py index afbeb68995..99103a61cf 100644 --- a/aeon/forecasting/base/_fh.py +++ b/aeon/forecasting/base/_fh.py @@ -686,24 +686,7 @@ def _to_relative(fh: ForecastingHorizon, cutoff=None) -> ForecastingHorizon: # time deltas absolute = _coerce_to_period(absolute, freq=fh.freq) cutoff = _coerce_to_period(cutoff, freq=fh.freq) - - # TODO: Replace when we upgrade our lower pandas bound - # to a version where this is fixed - # Compute relative values - # The following line circumvents the bug in pandas - # periods = pd.period_range(start="2021-01-01", periods=3, freq="2H") - # periods - periods[0] - # Out: Index([<0 * Hours>, <4 * Hours>, <8 * Hours>], dtype = 'object') - # [v - periods[0] for v in periods] - # Out: Index([<0 * Hours>, <2 * Hours>, <4 * Hours>], dtype='object') - # TODO: 0.17.0: Check if this comment below can be removed, - # so check if pandas has released the fix to PyPI: - # This bug was reported: https://github.com/pandas-dev/pandas/issues/45999 - # and fixed: https://github.com/pandas-dev/pandas/pull/46006 - # Most likely it will be released with pandas 1.5 - # Once the bug is fixed the line should simply be: - # relative = absolute - cutoff - relative = pd.Index([date - cutoff for date in absolute]) + relative = absolute - cutoff # Coerce durations (time deltas) into integer values for given frequency if isinstance(absolute, (pd.PeriodIndex, pd.DatetimeIndex)): diff --git a/aeon/forecasting/compose/_pipeline.py b/aeon/forecasting/compose/_pipeline.py index 177c5bb963..f28015cad4 100644 --- a/aeon/forecasting/compose/_pipeline.py +++ b/aeon/forecasting/compose/_pipeline.py @@ -1461,8 +1461,6 @@ def _predict_var(self, fh=None, X=None, cov=False): y_pred = self.forecaster_y_.predict_var(fh=fh, X=X) return y_pred - # todo: does not work properly for multivariate or hierarchical - # still need to implement this - once interface is consolidated def _predict_proba(self, fh, X, marginal=True): """Compute/return fully probabilistic forecasts. diff --git a/aeon/forecasting/compose/_reduce.py b/aeon/forecasting/compose/_reduce.py index 4cb8e6914c..6035b536cb 100644 --- a/aeon/forecasting/compose/_reduce.py +++ b/aeon/forecasting/compose/_reduce.py @@ -973,7 +973,6 @@ def _fit(self, y, X=None, fh=None): self : Estimator An fitted instance of self. """ - # todo: logic for X below is broken. Escape X until fixed. if X is not None: X = None @@ -1033,7 +1032,7 @@ def _predict_last_window( y_pred = pd.Series or pd.DataFrame """ # Exogenous variables are not yet support for the dirrec strategy. - # todo: implement this. For now, we escape. + if X is not None: X = None @@ -2144,21 +2143,20 @@ def _fit(self, y, X=None, fh=None): Parameters ---------- y : pd.DataFrame - mtype is pd.DataFrame, pd-multiindex, or pd_multiindex_hier + pd.DataFrame, pd-multiindex, or pd_multiindex_hier Time series to which to fit the forecaster. fh : guaranteed to be ForecastingHorizon or None, optional (default=None) The forecasting horizon with the steps ahead to to predict. Required (non-optional) here if self.get_tag("requires-fh-in-fit")==True Otherwise, if not passed in _fit, guaranteed to be passed in _predict X : pd.DataFrame optional (default=None) - mtype is pd.DataFrame, pd-multiindex, or pd_multiindex_hier + pd.DataFrame, pd-multiindex, or pd_multiindex_hier Exogeneous time series to fit to. Returns ------- self : reference to self """ - # todo: very similar to _fit_concurrent of DirectReductionForecaster - refactor? from aeon.transformations.impute import Imputer from aeon.transformations.lag import Lag @@ -2211,7 +2209,7 @@ def _predict(self, X=None, fh=None): The forecasting horizon with the steps ahead to to predict. If not passed in _fit, guaranteed to be passed here X : pd.DataFrame, optional (default=None) - mtype is pd.DataFrame, pd-multiindex, or pd_multiindex_hier + pd.DataFrame, pd-multiindex, or pd_multiindex_hier Exogeneous time series for the forecast Returns @@ -2378,7 +2376,7 @@ def get_test_params(cls, parameter_set="default"): params1 = { "estimator": est, "window_length": 3, - "pooling": "global", # all internal mtypes are tested across scenarios + "pooling": "global", } return params1 diff --git a/aeon/forecasting/model_selection/tests/test_split.py b/aeon/forecasting/model_selection/tests/test_split.py index 4b3a9a3bc8..9649529f17 100644 --- a/aeon/forecasting/model_selection/tests/test_split.py +++ b/aeon/forecasting/model_selection/tests/test_split.py @@ -475,11 +475,6 @@ def test_split_by_fh(index_type, fh_type, is_relative, values): """Test temporal_train_test_split.""" if fh_type == "timedelta": return None - # todo: ensure check_estimator works with pytest.skip like below - # pytest.skip( - # "ForecastingHorizon with timedelta values " - # "is currently experimental and not supported everywhere" - # ) y = _make_series(20, index_type=index_type) cutoff = get_cutoff(y.iloc[:10], return_index=True) fh = _make_fh(cutoff, values, fh_type, is_relative) diff --git a/aeon/forecasting/naive.py b/aeon/forecasting/naive.py index c4d0b5a4f9..7792986911 100644 --- a/aeon/forecasting/naive.py +++ b/aeon/forecasting/naive.py @@ -120,7 +120,6 @@ def __init__(self, strategy="last", window_length=None, sp=1): self.window_length = window_length # Override tag for handling missing data - # todo: remove if GH1367 is fixed if self.strategy in ("last", "mean"): self.set_tags(**{"capability:missing_values": True}) @@ -335,7 +334,6 @@ def _predict(self, fh=None, X=None): # test_predict_time_index_in_sample_full[ForecastingPipeline-0-int-int-True] # causes a pd.DataFrame to appear as y_pred, which upsets the next lines # reasons are unclear, this is coming from the _BaseWindowForecaster - # todo: investigate this if isinstance(y_pred, pd.DataFrame): y_pred = y_pred.iloc[:, 0] diff --git a/aeon/forecasting/reconcile.py b/aeon/forecasting/reconcile.py index 94178f1711..6e5df020fe 100644 --- a/aeon/forecasting/reconcile.py +++ b/aeon/forecasting/reconcile.py @@ -5,7 +5,6 @@ "ciaran-g", ] -# todo: top down historical proportions? -> new _get_g_matrix_prop(self) from warnings import warn diff --git a/aeon/forecasting/tests/test_all_forecasters.py b/aeon/forecasting/tests/test_all_forecasters.py index e68bf22898..eb0de710df 100644 --- a/aeon/forecasting/tests/test_all_forecasters.py +++ b/aeon/forecasting/tests/test_all_forecasters.py @@ -148,7 +148,6 @@ def test_get_fitted_params(self, estimator_instance, scenario): except NotImplementedError: pass - # todo: should these not be checked in test_all_estimators? def test_raises_not_fitted_error(self, estimator_instance): """Test that calling post-fit methods before fit raises error.""" # We here check extra method of the forecaster API: update and update_predict. @@ -177,14 +176,12 @@ def test_y_multivariate_raises_error(self, estimator_instance): # and "univariate" automatically vectorizes, behaves multivariate pass - # todo: should these not be "negative scenarios", tested in test_all_estimators? @pytest.mark.parametrize("y", INVALID_y_INPUT_TYPES) def test_y_invalid_type_raises_error(self, estimator_instance, y): """Test that invalid y input types raise error.""" with pytest.raises(TypeError, match=r"type"): estimator_instance.fit(y, fh=FH0) - # todo: should these not be "negative scenarios", tested in test_all_estimators? @pytest.mark.parametrize("X", INVALID_X_INPUT_TYPES) def test_X_invalid_type_raises_error(self, estimator_instance, n_columns, X): """Test that invalid X input types raise error.""" @@ -208,11 +205,6 @@ def test_predict_residuals( if fh_type == "timedelta": # workaround to ensure check_estimator without breaking e.g. debugging return None - # todo: ensure check_estimator works with pytest.skip like below - # pytest.skip( - # "ForecastingHorizon with timedelta values " - # "is currently experimental and not supported everywhere" - # ) y_train = _make_series( n_columns=n_columns, index_type=index_type, n_timepoints=50 ) @@ -244,11 +236,6 @@ def test_predict_time_index_with_X( index_type, fh_type, is_relative = index_fh_comb if fh_type == "timedelta": return None - # todo: ensure check_estimator works with pytest.skip like below - # pytest.skip( - # "ForecastingHorizon with timedelta values " - # "is currently experimental and not supported everywhere" - # ) z, X = make_forecasting_problem(index_type=index_type, make_X=True) # Some estimators may not support all time index types and fh types, hence we @@ -278,11 +265,6 @@ def test_predict_time_index_in_sample_full( index_type, fh_type, is_relative = index_fh_comb if fh_type == "timedelta": return None - # todo: ensure check_estimator works with pytest.skip like below - # pytest.skip( - # "ForecastingHorizon with timedelta values " - # "is currently experimental and not supported everywhere" - # ) y_train = _make_series(n_columns=n_columns, index_type=index_type) cutoff = get_cutoff(y_train, return_index=True) steps = -np.arange(len(y_train)) diff --git a/aeon/forecasting/theta.py b/aeon/forecasting/theta.py index a34b9ff900..3e412094e0 100644 --- a/aeon/forecasting/theta.py +++ b/aeon/forecasting/theta.py @@ -226,9 +226,6 @@ def _predict_quantiles(self, fh, X=None, alpha=None): # we assume normal additive noise with sem variance for a in alpha: pred_quantiles[("Quantiles", a)] = y_pred + norm.ppf(a) * sem - # todo: should this not increase with the horizon? - # i.e., sth like norm.ppf(a) * sem * fh.to_absolute(cutoff) ? - # I've just refactored this so will leave it for now return pred_quantiles diff --git a/aeon/performance_metrics/forecasting/_classes.py b/aeon/performance_metrics/forecasting/_classes.py index 7adbc07950..3766585fdc 100644 --- a/aeon/performance_metrics/forecasting/_classes.py +++ b/aeon/performance_metrics/forecasting/_classes.py @@ -430,7 +430,7 @@ def _check_consistent_input(self, y_true, y_pred, multioutput, multilevel): else: y_pred_orig.columns = y_true.columns # check multioutput arg - # todo: add this back when variance_weighted is supported + # add this back when variance_weighted is supported # ("raw_values", "uniform_average", "variance_weighted") allowed_multioutput_str = ("raw_values", "uniform_average") diff --git a/aeon/performance_metrics/forecasting/probabilistic/_classes.py b/aeon/performance_metrics/forecasting/probabilistic/_classes.py index 754c4bdd90..33b7a29d74 100644 --- a/aeon/performance_metrics/forecasting/probabilistic/_classes.py +++ b/aeon/performance_metrics/forecasting/probabilistic/_classes.py @@ -8,8 +8,6 @@ from aeon.datatypes import check_is_scitype, convert from aeon.performance_metrics.forecasting._classes import BaseForecastingErrorMetric -# TODO: Rework tests now - class _BaseProbaForecastingErrorMetric(BaseForecastingErrorMetric): """Base class for probabilistic forecasting error metrics in aeon. @@ -419,8 +417,6 @@ def _evaluate_by_index(self, y_true, y_pred, multioutput, **kwargs): # if alpha was provided, check whether they are predicted # if not all alpha are observed, raise a ValueError if not np.isin(alpha, y_pred_alphas).all(): - # todo: make error msg more informative - # which alphas are missing msg = "not all quantile values in alpha are available in y_pred" raise ValueError(msg) else: diff --git a/aeon/tests/test_all_estimators.py b/aeon/tests/test_all_estimators.py index e7ccd1890a..a5a74d5e07 100644 --- a/aeon/tests/test_all_estimators.py +++ b/aeon/tests/test_all_estimators.py @@ -629,8 +629,6 @@ def _check_None_str_or_list_of_str(obj, var_name="obj"): raise ValueError(msg) return obj - # todo: surely there is a pytest method that can be called instead of this? - # find and replace if it exists @staticmethod def _get_pytest_mark_args(fun): """Get args from pytest mark annotation of function. @@ -1319,7 +1317,6 @@ def test_dl_constructor_initializes_deeply(self, estimator_class): if vars(estimator._network).get(key) is not None: assert vars(estimator._network)[key] == value - # todo: this needs to be diagnosed and fixed - temporary skip @pytest.mark.skip(reason="hangs on mac and unix remote tests") def test_multiprocessing_idempotent( self, estimator_instance, scenario, method_nsc_arraylike diff --git a/aeon/tests/test_softdeps.py b/aeon/tests/test_softdeps.py index 62fe37fee3..84b4c94948 100644 --- a/aeon/tests/test_softdeps.py +++ b/aeon/tests/test_softdeps.py @@ -39,8 +39,6 @@ # for the reason that they are composites which have soft dependencies in examples # but no soft dependencies themselves, so it's temporarily fine to raise this # e.g., forecasting pipeline with an ARIMA estimator -# todo: long-term all example parameter settings should be soft dependency free -# strings of class names to avoid the imports EXCEPTED_FROM_NO_DEP_CHECK = [] diff --git a/aeon/transformations/boxcox.py b/aeon/transformations/boxcox.py index 2d63e5cc96..b5b8f05198 100644 --- a/aeon/transformations/boxcox.py +++ b/aeon/transformations/boxcox.py @@ -13,7 +13,7 @@ # copy-pasted from scipy 1.7.3 since it moved in 1.8.0 and broke this estimator -# todo: find a suitable replacement +# find a suitable replacement def _calc_uniform_order_statistic_medians(n): """Approximations of uniform order statistic medians. diff --git a/aeon/transformations/compose.py b/aeon/transformations/compose.py index d3df4b27d6..9654741de8 100644 --- a/aeon/transformations/compose.py +++ b/aeon/transformations/compose.py @@ -508,10 +508,6 @@ def __init__( super(FeatureUnion, self).__init__() - # todo: check for transform-input, transform-output - # for now, we assume it's always Series/Series or Series/Panel - # but no error is currently raised - # abbreviate for readability ests = self.transformer_list_ diff --git a/aeon/transformations/difference.py b/aeon/transformations/difference.py index 7f64848a98..4557cd19bf 100644 --- a/aeon/transformations/difference.py +++ b/aeon/transformations/difference.py @@ -380,10 +380,4 @@ def get_test_params(cls): `create_test_instance` uses the first (or only) dictionary in `params` """ params = [{"na_handling": x} for x in cls.VALID_NA_HANDLING_STR] - # we're testing that inverse_transform is inverse to transform - # and that is only correct if the first observation is not dropped - # todo: ensure that we have proper tests or escapes for "incomplete inverses" - params = params[1:] - # this removes "drop_na" setting where the inverse has problems - # need to deal with this in a better way in testing return params diff --git a/aeon/transformations/hierarchical/aggregate.py b/aeon/transformations/hierarchical/aggregate.py index dbdd23f3ab..251930002f 100644 --- a/aeon/transformations/hierarchical/aggregate.py +++ b/aeon/transformations/hierarchical/aggregate.py @@ -9,8 +9,6 @@ from aeon.transformations.base import BaseTransformer -# todo: add any necessary aeon internal imports here - class Aggregator(BaseTransformer): """Prepare hierarchical data, including aggregate levels, from bottom level. @@ -52,7 +50,6 @@ class Aggregator(BaseTransformer): "input_data_type": "Series", "output_data_type": "Series", "transform_labels": "None", - # todo instance wise? "instancewise": True, # is this an instance-wise transform? "X_inner_type": [ "pd.Series", diff --git a/aeon/transformations/hierarchical/reconcile.py b/aeon/transformations/hierarchical/reconcile.py index 5668550cf8..2e4bf72e90 100644 --- a/aeon/transformations/hierarchical/reconcile.py +++ b/aeon/transformations/hierarchical/reconcile.py @@ -14,8 +14,6 @@ from aeon.transformations.base import BaseTransformer from aeon.transformations.hierarchical.aggregate import _check_index_no_total -# TODO: failing test which are escaped - class Reconciler(BaseTransformer): """Hierarchical reconcilation transformer. diff --git a/aeon/transformations/lag.py b/aeon/transformations/lag.py index a5d204a053..3770352001 100644 --- a/aeon/transformations/lag.py +++ b/aeon/transformations/lag.py @@ -128,7 +128,6 @@ class Lag(BaseTransformer): "remember_data": True, # remember all data seen as _X } - # todo: add any hyper-parameters and components to constructor def __init__( self, lags=0, @@ -264,10 +263,6 @@ def _transform(self, X, y=None): return Xt - # todo: consider implementing this, optional - # if not implementing, delete the _inverse_transform method - # inverse transform exists only if transform does not change scitype - # i.e., Series transformed to Series def _inverse_transform(self, X, y=None): """Inverse transform, inverse operation to transform. @@ -292,11 +287,6 @@ def _inverse_transform(self, X, y=None): # return should be of same mtype as input, X_inner_type # if multiple X_inner_type are supported, ensure same input/output # - # todo: add the return mtype/scitype to the docstring, e.g., - # Returns - # ------- - # X_inv_transformed : Series of mtype pd.DataFrame - # inverse transformed version of X def _update(self, X, y=None): """Update transformer with X and y. @@ -315,8 +305,6 @@ def _update(self, X, y=None): """ return self - # todo: return default parameters, so that a test instance can be created - # required for automated unit and integration testing of estimator @classmethod def get_test_params(cls, parameter_set="default"): """Return testing parameter settings for the estimator. @@ -427,7 +415,6 @@ class ReducerTransform(BaseTransformer): "capability:missing_values:removes": False, } - # todo: add any hyper-parameters and components to constructor def __init__( self, lags=0, @@ -564,8 +551,6 @@ def _update(self, X, y=None): self.trafo_.update(X=X, y=y) return self - # todo: return default parameters, so that a test instance can be created - # required for automated unit and integration testing of estimator @classmethod def get_test_params(cls, parameter_set="default"): """Return testing parameter settings for the estimator. diff --git a/aeon/utils/_testing/hierarchical.py b/aeon/utils/_testing/hierarchical.py index 4f8d1df2d9..ffa8c2e9cc 100644 --- a/aeon/utils/_testing/hierarchical.py +++ b/aeon/utils/_testing/hierarchical.py @@ -167,7 +167,6 @@ def _bottom_hier_datagen( node_lookup[name] = node_lookup.groupby([name_groupby])[ "l1_agg" ].transform( - # TODO: the lambda function below should use `x`` but doesn't lambda x: "l" + str(i) # noqa: B023 + "_node" diff --git a/aeon/utils/_testing/tests/test_testscenario_getter.py b/aeon/utils/_testing/tests/test_testscenario_getter.py index 7f02fedda4..68a1eb0538 100644 --- a/aeon/utils/_testing/tests/test_testscenario_getter.py +++ b/aeon/utils/_testing/tests/test_testscenario_getter.py @@ -19,9 +19,6 @@ def test_get_scenarios_for_class(estimator_class): isinstance(x, TestScenario) for x in scenarios ), "return of retrieve_scenarios is not a list of scenarios" - # todo: remove once fully refactored to scenarios - # assert len(scenarios) > 0 - @pytest.mark.parametrize("scitype_string", BASE_CLASS_IDENTIFIER_LIST) def test_get_scenarios_for_string(scitype_string): @@ -33,9 +30,6 @@ def test_get_scenarios_for_string(scitype_string): isinstance(x, TestScenario) for x in scenarios ), "return of retrieve_scenarios is not a list of scenarios" - # todo: remove once fully refactored to scenarios - # assert len(scenarios) > 0 - def test_get_scenarios_errors(): """Test that errors are raised for bad input args.""" diff --git a/aeon/utils/mlflow_aeon.py b/aeon/utils/mlflow_aeon.py index 2081399548..d091c132eb 100644 --- a/aeon/utils/mlflow_aeon.py +++ b/aeon/utils/mlflow_aeon.py @@ -129,7 +129,7 @@ def save_model( pip_requirements=None, extra_pip_requirements=None, serialization_format=SERIALIZATION_FORMAT_PICKLE, -): # TODO: can we specify a type for fitted instance of aeon model below? +): """Save a aeon model to a path on the local file system. Parameters @@ -318,7 +318,7 @@ def log_model( extra_pip_requirements=None, serialization_format=SERIALIZATION_FORMAT_PICKLE, **kwargs, -): # TODO: can we specify a type for fitted instance of aeon model below? +): """ Log a aeon model as an MLflow artifact for the current run. @@ -787,6 +787,3 @@ def predict(self, X): predictions = raw_predictions[list(raw_predictions.keys())[0]] return predictions - - -# TODO: Add support for autologging diff --git a/examples/segmentation/segmentation_with_clasp.ipynb b/examples/segmentation/segmentation_with_clasp.ipynb index eead3eb53f..f955429978 100644 --- a/examples/segmentation/segmentation_with_clasp.ipynb +++ b/examples/segmentation/segmentation_with_clasp.ipynb @@ -78,9 +78,9 @@ "source": [ "# Time Series Segmentation through ClaSP\n", "\n", - "This Jupyter-Notebook illustrates the usage of the *Classification Score Profile (ClaSP)* for time series segmentation. \n", + "This Jupyter-Notebook illustrates the usage of the *Classification Score Profile (ClaSP)* for time series segmentation.\n", "\n", - "ClaSP hierarchically splits a TS into two parts, where each split point is determined by training a binary TS classifier for each possible split point and selecting the one with highest accuracy, i.e., the one that is best at identifying subsequences to be from either of the partitions. \n", + "ClaSP hierarchically splits a TS into two parts, where each split point is determined by training a binary TS classifier for each possible split point and selecting the one with highest accuracy, i.e., the one that is best at identifying subsequences to be from either of the partitions.\n", "\n", "Please refer to our paper, published at CIKM '21, for details:\n", "*P. Schäfer, A. Ermshaus, U. Leser, ClaSP - Time Series Segmentation, CIKM 2021*" @@ -115,7 +115,7 @@ "source": [ "# ClaSP - Classification Score Profile\n", "\n", - "Let's run ClaSP to find the true change point. \n", + "Let's run ClaSP to find the true change point.\n", "\n", "ClaSP has two hyper-parameters:\n", "- The period length\n", @@ -204,7 +204,7 @@ "source": [ "# ClaSP - Window Size Selection\n", "\n", - "ClaSP takes the window size 𝑤 as a hyper-parameter. This parameter has data-dependent effects on ClaSP’s performance. When chosen too small, all windows tend to appear similar; when chosen too large, windows have a higher chance to overlap adjacent segments, blurring their discriminative power. \n", + "ClaSP takes the window size 𝑤 as a hyper-parameter. This parameter has data-dependent effects on ClaSP’s performance. When chosen too small, all windows tend to appear similar; when chosen too large, windows have a higher chance to overlap adjacent segments, blurring their discriminative power.\n", "\n", "A simple, yet effective method for choosing the window size is the dominant frequency of the Fourier Transform." ]