From 70d9a72cde8f7a41f7ddad94781ccce1ca50d702 Mon Sep 17 00:00:00 2001 From: Tony Bagnall Date: Fri, 28 Jun 2024 20:09:35 +0100 Subject: [PATCH] [DOC] Improve BaseCollectionTransformer docstrings (#1733) * remove dependency * docs --- aeon/transformations/collection/base.py | 114 ++++++++++++++++++++---- 1 file changed, 95 insertions(+), 19 deletions(-) diff --git a/aeon/transformations/collection/base.py b/aeon/transformations/collection/base.py index e45e5a9498..9839ae23d8 100644 --- a/aeon/transformations/collection/base.py +++ b/aeon/transformations/collection/base.py @@ -66,10 +66,25 @@ def fit(self, X, y=None): Parameters ---------- - X : Input data - Data to fit transform to, of valid collection type. - y : Target variable, default=None - Additional data, e.g., labels for transformation + X : np.ndarray or list + Input data, any number of channels, equal length series of shape ``( + n_cases, n_channels, n_timepoints)`` + or list of numpy arrays (any number of channels, unequal length series) + of shape ``[n_cases]``, 2D np.array ``(n_channels, n_timepoints_i)``, + where ``n_timepoints_i`` is length of series ``i``. Other types are + allowed and converted into one of the above. + + Different estimators have different capabilities to handle different + types of input. If `self.get_tag("capability:multivariate")`` is False, + they cannot handle multivariate series. If ``self.get_tag( + "capability:unequal_length")`` is False, they cannot handle unequal + length input. In both situations, a ``ValueError`` is raised if X has a + characteristic that the estimator does not have the capability to handle. + Data to fit transform to, of valid collection type. + y : np.ndarray, default=None + 1D np.array of float or str, of shape ``(n_cases)`` - class labels + (ground truth) for fitting indices corresponding to instance indices in X. + If None, no labels are used in fitting. Returns ------- @@ -107,10 +122,25 @@ def transform(self, X, y=None): Parameters ---------- - X : Input data - Data to fit transform to, of valid collection type. - y : Target variable, default=None - Additional data, e.g., labels for transformation + X : np.ndarray or list + Input data, any number of channels, equal length series of shape ``( + n_cases, n_channels, n_timepoints)`` + or list of numpy arrays (any number of channels, unequal length series) + of shape ``[n_cases]``, 2D np.array ``(n_channels, n_timepoints_i)``, + where ``n_timepoints_i`` is length of series ``i``. Other types are + allowed and converted into one of the above. + + Different estimators have different capabilities to handle different + types of input. If `self.get_tag("capability:multivariate")`` is False, + they cannot handle multivariate series. If ``self.get_tag( + "capability:unequal_length")`` is False, they cannot handle unequal + length input. In both situations, a ``ValueError`` is raised if X has a + characteristic that the estimator does not have the capability to handle. + Data to fit transform to, of valid collection type. + y : np.ndarray, default=None + 1D np.array of float or str, of shape ``(n_cases)`` - class labels + (ground truth) for fitting indices corresponding to instance indices in X. + If None, no labels are used in fitting. Returns ------- @@ -146,10 +176,25 @@ def fit_transform(self, X, y=None): Parameters ---------- - X : Input data - Data to fit transform to, of valid collection type. - y : Target variable, default=None - Additional data, e.g., labels for transformation + X : np.ndarray or list + Input data, any number of channels, equal length series of shape ``( + n_cases, n_channels, n_timepoints)`` + or list of numpy arrays (any number of channels, unequal length series) + of shape ``[n_cases]``, 2D np.array ``(n_channels, n_timepoints_i)``, + where ``n_timepoints_i`` is length of series ``i``. Other types are + allowed and converted into one of the above. + + Different estimators have different capabilities to handle different + types of input. If `self.get_tag("capability:multivariate")`` is False, + they cannot handle multivariate series. If ``self.get_tag( + "capability:unequal_length")`` is False, they cannot handle unequal + length input. In both situations, a ``ValueError`` is raised if X has a + characteristic that the estimator does not have the capability to handle. + Data to fit transform to, of valid collection type. + y : np.ndarray, default=None + 1D np.array of float or str, of shape ``(n_cases)`` - class labels + (ground truth) for fitting indices corresponding to instance indices in X. + If None, no labels are used in fitting. Returns ------- @@ -184,10 +229,25 @@ def inverse_transform(self, X, y=None): Parameters ---------- - X : Input data - Data to fit transform to, of valid collection type. - y : Target variable, default=None - Additional data, e.g., labels for transformation + X : np.ndarray or list + Input data, any number of channels, equal length series of shape ``( + n_cases, n_channels, n_timepoints)`` + or list of numpy arrays (any number of channels, unequal length series) + of shape ``[n_cases]``, 2D np.array ``(n_channels, n_timepoints_i)``, + where ``n_timepoints_i`` is length of series ``i``. Other types are + allowed and converted into one of the above. + + Different estimators have different capabilities to handle different + types of input. If `self.get_tag("capability:multivariate")`` is False, + they cannot handle multivariate series. If ``self.get_tag( + "capability:unequal_length")`` is False, they cannot handle unequal + length input. In both situations, a ``ValueError`` is raised if X has a + characteristic that the estimator does not have the capability to handle. + Data to fit transform to, of valid collection type. + y : np.ndarray, default=None + 1D np.array of float or str, of shape ``(n_cases)`` - class labels + (ground truth) for fitting indices corresponding to instance indices in X. + If None, no labels are used in fitting. Returns ------- @@ -231,9 +291,25 @@ def update(self, X, y=None, update_params=True): Parameters ---------- - X : data to update of valid collection type. - y : Target variable, default=None - Additional data, e.g., labels for transformation + X : np.ndarray or list + Input data, any number of channels, equal length series of shape ``( + n_cases, n_channels, n_timepoints)`` + or list of numpy arrays (any number of channels, unequal length series) + of shape ``[n_cases]``, 2D np.array ``(n_channels, n_timepoints_i)``, + where ``n_timepoints_i`` is length of series ``i``. Other types are + allowed and converted into one of the above. + + Different estimators have different capabilities to handle different + types of input. If `self.get_tag("capability:multivariate")`` is False, + they cannot handle multivariate series. If ``self.get_tag( + "capability:unequal_length")`` is False, they cannot handle unequal + length input. In both situations, a ``ValueError`` is raised if X has a + characteristic that the estimator does not have the capability to handle. + Data to fit transform to, of valid collection type. + y : np.ndarray, default=None + 1D np.array of float or str, of shape ``(n_cases)`` - class labels + (ground truth) for fitting indices corresponding to instance indices in X. + If None, no labels are used in fitting. update_params : bool, default=True whether the model is updated. Yes if true, if false, simply skips call. argument exists for compatibility with forecasting module.