Skip to content

Commit 8a5edf5

Browse files
author
Sebastian Schmidl
authored
[DOC] Fix some documentation warnings (#1581)
* chore: fix docs - header Examples - header Returns - header References * fix: documentation indentation for ChannelEnsembleClassifier
1 parent ac99386 commit 8a5edf5

File tree

22 files changed

+106
-113
lines changed

22 files changed

+106
-113
lines changed

aeon/base/_meta.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,8 @@ def _anytagis(self, tag_name, value, estimators):
557557
value : value of the tag to check for
558558
estimators : list of (str, estimator) pairs to query for the tag/value
559559
560-
Return
561-
------
560+
Returns
561+
-------
562562
bool : True iff at least one estimator in the list has value in tag tag_name
563563
"""
564564
tagis = [est.get_tag(tag_name, value) == value for _, est in estimators]
@@ -591,8 +591,8 @@ def _anytag_notnone_val(self, tag_name, estimators):
591591
tag_name : str, name of the tag
592592
estimators : list of (str, estimator) pairs to query for the tag/value
593593
594-
Return
595-
------
594+
Returns
595+
-------
596596
tag_val : first non-'None' value of tag `tag_name` in estimator list.
597597
"""
598598
for _, est in estimators:
@@ -711,8 +711,8 @@ def flatten(obj):
711711
list or tuple, tuple if obj was tuple, list otherwise
712712
flat iterable, containing non-list/tuple elements in obj in same order as in obj
713713
714-
Example
715-
-------
714+
Examples
715+
--------
716716
>>> flatten([1, 2, [3, (4, 5)], 6])
717717
[1, 2, 3, 4, 5, 6]
718718
"""
@@ -737,8 +737,8 @@ def unflatten(obj, template):
737737
has element bracketing exactly as `template`
738738
and elements in sequence exactly as `obj`
739739
740-
Example
741-
-------
740+
Examples
741+
--------
742742
>>> unflatten([1, 2, 3, 4, 5, 6], [6, 3, [5, (2, 4)], 1])
743743
[1, 2, [3, (4, 5)], 6]
744744
"""

aeon/benchmarking/results_loaders.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ def estimator_alias(name: str) -> str:
189189
name: str
190190
Standardized name as defined by NAME_ALIASES.
191191
192-
Example
193-
-------
192+
Examples
193+
--------
194194
>>> from aeon.benchmarking.results_loaders import estimator_alias
195195
>>> estimator_alias("HIVECOTEV2")
196196
'HC2'
@@ -223,8 +223,8 @@ def get_available_estimators(task="classification", return_dataframe=True):
223223
pd.DataFrame or List
224224
Standardised name as defined by NAME_ALIASES.
225225
226-
Example
227-
-------
226+
Examples
227+
--------
228228
>>> from aeon.benchmarking.results_loaders import get_available_estimators
229229
>>> cls = get_available_estimators("Classification") # doctest: +SKIP
230230
"""
@@ -307,8 +307,8 @@ def get_estimator_results(
307307
dataset names for keys and results as the value. If default only is an
308308
np.ndarray.
309309
310-
Example
311-
-------
310+
Examples
311+
--------
312312
>>> from aeon.benchmarking.results_loaders import get_estimator_results
313313
>>> cls = ["HC2"] # doctest: +SKIP
314314
>>> data = ["Chinatown", "Adiac"] # doctest: +SKIP
@@ -376,8 +376,8 @@ def get_estimator_results_as_array(
376376
Each column is a results for a classifier, each row a dataset.
377377
if include_missing == false, returns names: an aligned list of names of included.
378378
379-
Example
380-
-------
379+
Examples
380+
--------
381381
>>> from aeon.benchmarking.results_loaders import get_estimator_results
382382
>>> cls = ["HC2", "FreshPRINCE"] # doctest: +SKIP
383383
>>> data = ["Chinatown", "Adiac"] # doctest: +SKIP

aeon/classification/compose/_channel_ensemble.py

+9-16
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ def _predict(self, X) -> np.ndarray:
177177

178178

179179
class ChannelEnsembleClassifier(_BaseChannelEnsembleClassifier):
180-
"""
181-
Applies estimators to channels of an array.
180+
"""Applies estimators to channels of an array.
182181
183182
This estimator allows different channels or channel subsets of the input
184183
to be transformed separately and the features generated by each
@@ -197,8 +196,8 @@ class ChannelEnsembleClassifier(_BaseChannelEnsembleClassifier):
197196
Estimator must support `fit` and `predict_proba`. Special-cased
198197
strings 'drop' and 'passthrough' are accepted as well, to
199198
indicate to drop the channels.
200-
channels(s) : array-like of int, slice, boolean mask array. Integer channels
201-
are indexed from 0
199+
channels(s) : array-like of int, slice, boolean mask array
200+
Integer channels are indexed from 0.
202201
remainder : {'drop', 'passthrough'} or estimator, default 'drop'
203202
By default, only the specified channels in `transformations` are
204203
transformed and combined in the output, and the non-specified
@@ -258,9 +257,9 @@ def get_test_params(cls, parameter_set="default"):
258257
Name of the set of test parameters to return, for use in tests. If no
259258
special parameters are defined for a value, will return `"default"` set.
260259
ChannelEnsembleClassifier provides the following special sets:
261-
"results_comparison" - used in some classifiers to compare against
262-
previously generated results where the default set of parameters
263-
cannot produce suitable probability estimates
260+
- "results_comparison" - used in some classifiers to compare against
261+
previously generated results where the default set of parameters
262+
cannot produce suitable probability estimates
264263
265264
Returns
266265
-------
@@ -293,8 +292,7 @@ def get_test_params(cls, parameter_set="default"):
293292

294293

295294
def _get_channel(X, key):
296-
"""
297-
Get time series channel(s) from input data X.
295+
"""Get time series channel(s) from input data X.
298296
299297
Supported input types (X): numpy arrays
300298
@@ -311,7 +309,6 @@ def _get_channel(X, key):
311309
- only supported for dataframes
312310
- So no keys other than strings are allowed (while in principle you
313311
can use any hashable object as key).
314-
315312
"""
316313
# check whether we have string channel names or integers
317314
if _check_key_type(key, int):
@@ -340,8 +337,7 @@ def _get_channel(X, key):
340337

341338

342339
def _check_key_type(key, superclass):
343-
"""
344-
Check that scalar, list or slice is of a certain type.
340+
"""Check that scalar, list or slice is of a certain type.
345341
346342
This is only used in _get_channel and _get_channel_indices to check
347343
if the `key` (channel specification) is fully integer or fully string-like.
@@ -352,7 +348,6 @@ def _check_key_type(key, superclass):
352348
The channel specification to check
353349
superclass : int or str
354350
The type for which to check the `key`
355-
356351
"""
357352
if isinstance(key, superclass):
358353
return True
@@ -372,11 +367,9 @@ def _check_key_type(key, superclass):
372367

373368

374369
def _get_channel_indices(X, key):
375-
"""
376-
Get feature channel indices for input data X and key.
370+
"""Get feature channel indices for input data X and key.
377371
378372
For accepted values of `key`, see the docstring of _get_channel
379-
380373
"""
381374
n_channels = X.shape[1]
382375

aeon/classification/shapelet_based/_rsast_classifier.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class RSASTClassifier(BaseClassifier):
3838
Number of threads to use for the transform.
3939
4040
41-
Reference
42-
---------
41+
References
42+
----------
4343
.. [1] Varela, N. R., Mbouopda, M. F., & Nguifo, E. M. (2023). RSAST: Sampling
4444
Shapelets for Time Series Classification.
4545
https://hal.science/hal-04311309/
@@ -90,8 +90,8 @@ def _fit(self, X, y):
9090
y: array-like or list
9191
The class values for X.
9292
93-
Return
94-
------
93+
Returns
94+
-------
9595
self : RSASTClassifier
9696
This pipeline classifier
9797
@@ -127,8 +127,8 @@ def _predict(self, X):
127127
X: np.ndarray shape (n_cases, n_channels, n_timepoints)
128128
The training input samples.
129129
130-
Return
131-
------
130+
Returns
131+
-------
132132
array-like or list
133133
Predicted class labels.
134134
"""
@@ -142,8 +142,8 @@ def _predict_proba(self, X):
142142
X: np.ndarray shape (n_cases, n_channels, n_timepoints)
143143
The training input samples.
144144
145-
Return
146-
------
145+
Returns
146+
-------
147147
dists : np.ndarray shape (n_cases, n_timepoints)
148148
Predicted class probabilities.
149149
"""

aeon/classification/shapelet_based/_sast_classifier.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ class SASTClassifier(BaseClassifier):
3838
Number of threads to use for the transform.
3939
4040
41-
Reference
42-
---------
41+
References
42+
----------
4343
.. [1] Mbouopda, Michael Franklin, and Engelbert Mephu Nguifo.
44-
"Scalable and accurate subsequence transform for time series classification."
45-
Pattern Recognition 147 (2023): 110121.
46-
https://www.sciencedirect.com/science/article/abs/pii/S003132032300818X,
47-
https://uca.hal.science/hal-03087686/document
44+
"Scalable and accurate subsequence transform for time series classification."
45+
Pattern Recognition 147 (2023): 110121.
46+
https://www.sciencedirect.com/science/article/abs/pii/S003132032300818X,
47+
https://uca.hal.science/hal-03087686/document
4848
4949
Examples
5050
--------
@@ -92,8 +92,8 @@ def _fit(self, X, y):
9292
y: array-like or list
9393
The class values for X.
9494
95-
Return
96-
------
95+
Returns
96+
-------
9797
self : SASTClassifier
9898
This pipeline classifier
9999
@@ -129,8 +129,8 @@ def _predict(self, X):
129129
X: np.ndarray shape (n_cases, n_channels, n_timepoints)
130130
The training input samples.
131131
132-
Return
133-
------
132+
Returns
133+
-------
134134
array-like or list
135135
Predicted class labels.
136136
"""
@@ -144,8 +144,8 @@ def _predict_proba(self, X):
144144
X: np.ndarray shape (n_cases, n_channels, n_timepoints)
145145
The training input samples.
146146
147-
Return
148-
------
147+
Returns
148+
-------
149149
dists : np.ndarray shape (n_cases, n_timepoints)
150150
Predicted class probabilities.
151151
"""

aeon/clustering/_kernel_k_means.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ class TimeSeriesKernelKMeans(BaseClusterer):
6464
n_iter_: int
6565
Number of iterations run.
6666
67-
Reference
68-
---------
69-
.. [1] Kernel k-means, Spectral Clustering and Normalized Cuts. Inderjit S.
70-
Dhillon, Yuqiang Guan, Brian Kulis. KDD 2004.
71-
.. [2] Fast Global Alignment Kernels. Marco Cuturi. ICML 2011.
67+
References
68+
----------
69+
.. [1] Kernel k-means, Spectral Clustering and Normalized Cuts. Inderjit S.
70+
Dhillon, Yuqiang Guan, Brian Kulis. KDD 2004.
71+
.. [2] Fast Global Alignment Kernels. Marco Cuturi. ICML 2011.
7272
7373
Examples
7474
--------

aeon/datasets/_data_loaders.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,8 @@ def load_forecasting(name, extract_path=None, return_metadata=False):
977977
If a dataset name that does not exist on the repo is given or if a
978978
webpage is requested that does not exist.
979979
980-
Example
981-
-------
980+
Examples
981+
--------
982982
>>> from aeon.datasets import load_forecasting
983983
>>> X=load_forecasting("m1_yearly_dataset") # doctest: +SKIP
984984
"""
@@ -1134,8 +1134,8 @@ def load_regression(
11341134
'problemname',timestamps, missing,univariate,equallength.
11351135
targetlabel should be true, and classlabel false
11361136
1137-
Example
1138-
-------
1137+
Examples
1138+
--------
11391139
>>> from aeon.datasets import load_regression
11401140
>>> X, y=load_regression("FloodModeling1") # doctest: +SKIP
11411141
"""

aeon/datasets/_single_problem_loaders.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,8 @@ def load_solar(
950950
api_version : string or None, default="v4"
951951
API version to call. If None then a stored sample of the data is loaded.
952952
953-
Return
954-
------
953+
Returns
954+
-------
955955
pd.Series
956956
957957
References

aeon/forecasting/vecm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class VECM(_StatsModelsAdapter):
5757
2D ndarray/pd.DataFrame of size (any, neqs)
5858
Forcasted value of exog_coint
5959
60-
Example
61-
-------
60+
Examples
61+
--------
6262
>>> from aeon.forecasting.vecm import VECM
6363
>>> from aeon.forecasting.model_selection import temporal_train_test_split
6464
>>> from aeon.forecasting.base import ForecastingHorizon

aeon/segmentation/_igts.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ class _IGTS:
154154
Pervasive and Mobile Computing, 38, 92-109, (2017).
155155
https://www.sciencedirect.com/science/article/abs/pii/S1574119217300081
156156
157-
Example
158-
-------
157+
Examples
158+
--------
159159
>>> from aeon.testing.utils.data_gen import piecewise_normal_multivariate
160160
>>> from sklearn.preprocessing import MinMaxScaler
161161
>>> from aeon.segmentation import InformationGainSegmenter

aeon/transformations/collection/interpolate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class TSInterpolator(BaseCollectionTransformer):
1919
----------
2020
length : integer, the length of time series to resize to.
2121
22-
Example
23-
-------
22+
Examples
23+
--------
2424
>>> import numpy as np
2525
>>> from aeon.transformations.collection.interpolate import TSInterpolator
2626
>>> # Unequal length collection of time series

aeon/transformations/collection/pad.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class PaddingTransformer(BaseCollectionTransformer):
3636
each time series. Supported statistic strings are "mean", "median", "max",
3737
"min".
3838
39-
Example
40-
-------
39+
Examples
40+
--------
4141
>>> from aeon.transformations.collection import PaddingTransformer
4242
>>> import numpy as np
4343
>>> X = []

aeon/transformations/collection/shapelet_based/_rsast.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class RSAST(BaseCollectionTransformer):
6666
n_jobs : int, default -1
6767
Number of threads to use for the transform.
6868
69-
Reference
70-
---------
69+
References
70+
----------
7171
.. [1] Varela, N. R., Mbouopda, M. F., & Nguifo, E. M. (2023).
7272
RSAST: Sampling Shapelets for Time Series Classification.
7373
https://hal.science/hal-04311309/
@@ -127,8 +127,8 @@ def _fit(self, X, y):
127127
y: array-like or list
128128
The class values for X.
129129
130-
Return
131-
------
130+
Returns
131+
-------
132132
self : RSAST
133133
This transformer
134134
@@ -313,8 +313,8 @@ def _transform(self, X, y=None):
313313
y: array-like or list
314314
Ignored argument, interface compatibility
315315
316-
Return
317-
------
316+
Returns
317+
-------
318318
X_transformed: np.ndarray shape (n_cases, n_timepoints),
319319
The transformed data
320320
"""

0 commit comments

Comments
 (0)