Skip to content

Commit 5a22835

Browse files
committed
Fix docstring inconsistencies in benchmarking module - resolves aeon-toolkit#809
1 parent aa657d0 commit 5a22835

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

aeon/benchmarking/metrics/anomaly_detection/thresholding.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def top_k_points_threshold(
6969
Computes a threshold based on the number of expected anomalies (number of
7070
anomalies). This method iterates over all possible thresholds from high to low to
7171
find the first threshold that yields ``k`` or more anomalous points. If ``k``
72-
is ``None``,the ground truth data is used to calculate the real number of
72+
is ``None``,the ground truth data is used to calculate the real number of
7373
anomalies.
7474
7575
Parameters
@@ -79,7 +79,7 @@ def top_k_points_threshold(
7979
y_score : np.ndarray
8080
Anomaly scores for each point of the time series of shape (n_instances,).
8181
k : optional int
82-
Number of expected anomalies. If ``k`` is ``None``, the ground truth data
82+
Number of expected anomalies. If ``k`` is ``None``, the ground truth data
8383
is used to calculate the real number of anomalies.
8484
8585
Returns
@@ -103,7 +103,7 @@ def top_k_ranges_threshold(
103103
Computes a threshold based on the number of expected anomalous subsequences /
104104
ranges (number of anomalies). This method iterates over all possible thresholds
105105
from high to low to find the first threshold that yields `k` or more continuous
106-
anomalous ranges. If ``k`` is ``None``, the ground truth data is used to
106+
anomalous ranges. If ``k`` is ``None``, the ground truth data is used to
107107
calculate the real number of anomalies (anomalous ranges).
108108
109109
Parameters
@@ -113,8 +113,8 @@ def top_k_ranges_threshold(
113113
y_score : np.ndarray
114114
Anomaly scores for each point of the time series of shape (n_instances,).
115115
k : optional int
116-
Number of expected anomalies. If ``k`` is ``None``, the ground truth data is used
117-
to calculate the real number of anomalies.
116+
Number of expected anomalies. If ``k`` is ``None``, the ground truth data
117+
is used to calculate the real number of anomalies.
118118
119119
Returns
120120
-------

aeon/benchmarking/published_results.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,4 @@ def load_classification_bake_off_2023_results(num_resamples=30, as_array=False):
318318
res, classifiers, univariate_equal_length, False
319319
)
320320
return res, datasets, classifiers
321-
return res
321+
return res

aeon/benchmarking/resampling.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def resample_data_indices(y_train, y_test, random_state=None):
9595
random_state : int, RandomState instance or None, default=None
9696
If ``int``, random_state is the seed used by the random number generator;
9797
If ``RandomState`` instance, random_state is the random number generator;
98-
If ``None``, the random number generator is the ``RandomState`` instance
98+
If ``None``, the random number generator is the ``RandomState`` instance
9999
used by ``np.random``.
100100
101101
Returns
@@ -138,7 +138,7 @@ def stratified_resample_data(X_train, y_train, X_test, y_test, random_state=None
138138
random_state : int, RandomState instance or None, default=None
139139
If ``int``, random_state is the seed used by the random number generator;
140140
If ``RandomState`` instance, random_state is the random number generator;
141-
If ``None``, the random number generator is the ``RandomState`` instance
141+
If ``None``, the random number generator is the ``RandomState`` instance
142142
used by ``np.random``.
143143
144144
Returns
@@ -202,7 +202,7 @@ def stratified_resample_data_indices(y_train, y_test, random_state=None):
202202
random_state : int, RandomState instance or None, default=None
203203
If ``int``, random_state is the seed used by the random number generator;
204204
If ``RandomState`` instance, random_state is the random number generator;
205-
If ``None``, the random number generator is the ``RandomState`` instance
205+
If ``None``, the random number generator is the ``RandomState`` instance
206206
used by ``np.random``.
207207
208208
Returns
@@ -247,4 +247,4 @@ def stratified_resample_data_indices(y_train, y_test, random_state=None):
247247
[test_indices, indices[counts_train[label_index] :]], axis=None
248248
)
249249

250-
return train_indices, test_indices
250+
return train_indices, test_indices

aeon/benchmarking/results_loaders.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,4 +471,4 @@ def _results_dict_to_array(res_dict, estimators, datasets, include_missing):
471471
if include:
472472
results.append(r)
473473
names.append(data)
474-
return np.array(results), names
474+
return np.array(results), names

aeon/benchmarking/stats.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,4 +311,4 @@ def wilcoxon_test(results, labels, lower_better=False):
311311
zero_method="wilcox",
312312
alternative="less" if lower_better else "greater",
313313
).pvalue
314-
return p_values
314+
return p_values

0 commit comments

Comments
 (0)