Skip to content

Commit

Permalink
Added the improvements to _base and _base_series
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzb56 committed Mar 5, 2025
1 parent 3106722 commit a66df53
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 4 deletions.
32 changes: 31 additions & 1 deletion aeon/base/_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
"""Base class template for aeon estimators."""
"""Base class template for aeon estimators.
BaseAeonEstimator: Base class for aeon estimators.
Main Features:
- Provides a standard framework for defining estimators in aeon.
- Manages estimator state, cloning, and dynamic tagging.
Key Methods:
- `reset(keep)`: Resets the estimator while preserving specific attributes.
- `clone(random_state)`: Creates a copy of the estimator.
- `get_class_tags() / get_class_tag(tag_name)`: Retrieves static class tags.
- `get_tags() / get_tag(tag_name)`: Retrieves both static and dynamic tags.
- `set_tags(**tag_dict)`: Modifies dynamic tags.
- `get_fitted_params(deep)`: Extracts fitted parameters from the estimator.
- `_check_is_fitted()`: Ensures the estimator is fitted before use.
- `_create_test_instance()`: Generates test instances for validation.
Attributes:
- `is_fitted`: Boolean flag indicating if `fit()` has been called.
- `_tags`: Dictionary containing static metadata about the estimator.
- `_tags_dynamic`: Dictionary for dynamic metadata modifications.
Sklearn Compatibility:
- Overrides `__sklearn_is_fitted__()` for compatibility.
- `_validate_data()` and `get_metadata_routing()` raise NotImplementedError.
Helper Functions:
- `_clone_estimator(base_estimator, random_state)`: Clones an estimator.
"""


__maintainer__ = ["MatthewMiddlehurst", "TonyBagnall"]
__all__ = ["BaseAeonEstimator"]
Expand Down
30 changes: 27 additions & 3 deletions aeon/base/_base_series.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
"""Base class for estimators that fit single time series.
"""
Base class for estimators that fit single time series.
This time series can be univariate or multivariate, with potential missing values.
Class Name:
BaseSeriesEstimator
Defining Methods:
- _preprocess_series(self, X, axis, store_metadata)
Preprocesses input X before calling fit, ensuring it is in a valid format.
- _check_X(self, X, axis)
Validates input X, checking type, multivariate/univariate structure, and missing values.
- _convert_X(self, X, axis)
Converts input X to the required internal format based on estimator tags.
Inherited Methods:
- get_params(): Returns hyper-parameter details.
- get_fitted_params(): Returns fitted model parameters.
State Attributes:
- metadata_: Stores metadata about input time series.
- axis: Determines the time point axis for input data.
- _tags: Dictionary defining estimator capabilities (e.g., univariate, multivariate support).
This time series can be univariate or multivariate. The time series can potentially
contain missing values.
"""


__maintainer__ = ["TonyBagnall", "MatthewMiddlehurst"]
__all__ = ["BaseSeriesEstimator"]

Expand Down

0 comments on commit a66df53

Please sign in to comment.