@@ -25,7 +25,7 @@ def __apply_spectral_clustering(betas, runids, datasets, idsets, random_state=11
25
25
idsets: list
26
26
List where the grouped ids corresponding to the grouped Betas will be saved
27
27
**kwargs: keyword arguments
28
- Keyword arguments specific for the SpectralClustering algorythm
28
+ Keyword arguments specific for the SpectralClustering algorithm
29
29
30
30
See Also
31
31
--------
@@ -62,7 +62,7 @@ def __apply_k_means(betas, runids, datasets, idsets, random_state=11, **kwargs):
62
62
idsets: list
63
63
List where the grouped ids corresponding to the grouped Betas will be saved
64
64
**kwargs: keyword arguments
65
- Keyword arguments specific fot the KMeans algorythm
65
+ Keyword arguments specific for the KMeans algorithm
66
66
67
67
See Also
68
68
--------
@@ -85,7 +85,7 @@ def __apply_k_means(betas, runids, datasets, idsets, random_state=11, **kwargs):
85
85
def __apply_dbscan (betas , runids , datasets , idsets , ** kwargs ):
86
86
"""
87
87
Method to group the input Betas.
88
- Defautl keyword arguments: eps=0.08
88
+ Default keyword arguments: eps=0.08
89
89
90
90
Parameters
91
91
----------
@@ -98,7 +98,7 @@ def __apply_dbscan(betas, runids, datasets, idsets, **kwargs):
98
98
idsets: list
99
99
List where the grouped ids corresponding to the grouped Betas will be saved
100
100
**kwags: keyword arguments
101
- Keyword arguments for the DBSCAN algorythm
101
+ Keyword arguments for the DBSCAN algorithm
102
102
103
103
See Also
104
104
--------
@@ -158,7 +158,7 @@ def __detect_outliers_isolation_forest(
158
158
betas , ids , beta_clusters , id_clusters , random_state = 11 , ** kwargs
159
159
):
160
160
"""
161
- Detects outliers based on the IsolationForest algorythm from sklearn.
161
+ Detects outliers based on the IsolationForest algorithm from sklearn.
162
162
Detected outliers will be appended into the provided lists
163
163
Default keyword parameters: random_state=12, behaviour="new", contamination=0.005
164
164
@@ -173,7 +173,7 @@ def __detect_outliers_isolation_forest(
173
173
id_clusters: list
174
174
List where each cluster of ids will be appended
175
175
**kwargs: keyword argument
176
- Keywords specific to the IsolationForest algorythm
176
+ Keywords specific to the IsolationForest algorithm
177
177
Returns
178
178
-------
179
179
inlier_betas: np.array
@@ -198,7 +198,7 @@ def __detect_outliers_isolation_forest(
198
198
199
199
def __detect_outliers_local_outlier_factor (betas , ids , beta_clusters , id_clusters , ** kwargs ):
200
200
"""
201
- Detects outliers based on the LocalOutlierFactor algorythm from sklearn.
201
+ Detects outliers based on the LocalOutlierFactor algorithm from sklearn.
202
202
Detected outliers will be appended into the provided lists
203
203
Default keyword parameters: contamination=0.01
204
204
@@ -213,7 +213,7 @@ def __detect_outliers_local_outlier_factor(betas, ids, beta_clusters, id_cluster
213
213
id_clusters: list
214
214
List where each cluster of ids will be appended
215
215
**kwargs: keyword argument
216
- Keywords specific to the LocalOutlierFactor algorythm .
216
+ Keywords specific to the LocalOutlierFactor algorithm .
217
217
Returns
218
218
-------
219
219
inlier_betas: np.ndarray
@@ -238,9 +238,9 @@ def __detect_outliers_local_outlier_factor(betas, ids, beta_clusters, id_cluster
238
238
239
239
def __detect_outliers_one_class_svm (betas , ids , beta_clusters , id_clusters , ** kwargs ):
240
240
"""
241
- Detects outliers based on the OneClassSVM algorythm from sklearn.
241
+ Detects outliers based on the OneClassSVM algorithm from sklearn.
242
242
Detected outliers will be appended into the provided lists
243
- Defautl keyword arguments: gamma=0.1, nu=0.01
243
+ Default keyword arguments: gamma=0.1, nu=0.01
244
244
245
245
Parameters
246
246
----------
@@ -253,7 +253,7 @@ def __detect_outliers_one_class_svm(betas, ids, beta_clusters, id_clusters, **kw
253
253
id_clusters: list
254
254
List where each cluster of ids will be appended
255
255
**kwargs: keyword argument
256
- Keywords specific to the OneClassSVM algorythm .
256
+ Keywords specific to the OneClassSVM algorithm .
257
257
258
258
Returns
259
259
-------
@@ -280,7 +280,7 @@ def __detect_outliers_one_class_svm(betas, ids, beta_clusters, id_clusters, **kw
280
280
281
281
def __experimental_outlier_detector (betas , ids , ** kwargs ):
282
282
"""
283
- Detects outliers by applying LocalOutlierFactor algorythm from sklearn over multiple slices of betas .
283
+ Detects outliers by applying LocalOutlierFactor algorithm from sklearn over multiple slices of betas .
284
284
Detected outliers will be appended into the provided lists
285
285
Default keyword arguments: contamination=0.01
286
286
Parameters
@@ -290,7 +290,7 @@ def __experimental_outlier_detector(betas, ids, **kwargs):
290
290
ids: np.ndarray
291
291
Numpy array containing the ids of each beta
292
292
**kwargs: keyword argument
293
- Keywords specific to the LocalOutlierFactor algorythm
293
+ Keywords specific to the LocalOutlierFactor algorithm
294
294
Returns
295
295
-------
296
296
outliers: np.array
@@ -583,9 +583,9 @@ def group_betas(
583
583
) -> Union [Tuple [list , list ], str ]:
584
584
"""
585
585
Base function to to group betas into groups, detect outliers. Provides that all different
586
- clustering and outlier detection algorythms are implemented in an easy to access environment.
586
+ clustering and outlier detection algorithms are implemented in an easy to access environment.
587
587
To select different clustering and outlier detection algoyrthms, please use appropriate
588
- KeywordTypes. A description of each function can be accessed with document_algorythm (keyword)
588
+ KeywordTypes. A description of each function can be accessed with document_algorithm (keyword)
589
589
A list of all functions can be accessed with list_detectors_and_clusters()
590
590
591
591
Parameters
@@ -595,25 +595,25 @@ def group_betas(
595
595
betas: np.ndarray
596
596
Numpy array containing the betas.
597
597
Betas are expected to be of shape (samples, timestep, 3)
598
- The three entries per beta can either be dimesnions (x,y,z) or any three betas/eigenvalues
598
+ The three entries per beta can either be dimensions (x,y,z) or any three betas/eigenvalues
599
599
cluster: str, optional, default : "KMeans".
600
- String specifying which clustering algorythm shall be applied.
600
+ String specifying which clustering algorithm shall be applied.
601
601
Use ClusterTypefor easier access
602
602
detector: str, optional, default: None.
603
- String specifying which outlier detection algorythm shall be applied.
603
+ String specifying which outlier detection algorithm shall be applied.
604
604
Use DetectorType for easier access
605
605
cluster_params: dict, optional
606
- Dictionary containing parameters for the clustering algorythms .
606
+ Dictionary containing parameters for the clustering algorithms .
607
607
See the sklearn documentation for the function to learn more.
608
608
detector_params: dict, optional
609
- Dictionary containing parameters for the outlier detection algorythms .
609
+ Dictionary containing parameters for the outlier detection algorithms .
610
610
See the sklearn documentation for the function to learn more
611
611
612
612
Returns
613
613
-------
614
614
beta_clusters: list
615
615
List containing Numpy Arrays of betas in one cluster.
616
- If a detector was selected, or the clustering algorythm has its
616
+ If a detector was selected, or the clustering algorithm has its
617
617
own outlier detection, the first entry in the list will be oultier betas
618
618
id_clusters: list
619
619
List containing lists of beta ids. Each id corresponds to the beta in
@@ -626,13 +626,13 @@ def group_betas(
626
626
document_algorithm:
627
627
Prints docstring of each function into console
628
628
list_detectors_and_clusters:
629
- Prints out all detection and clustering algorythms into console
629
+ Prints out all detection and clustering algorithms into console
630
630
Sklearn Userguide chapter 2.3 Clustering:
631
631
https://scikit-learn.org/stable/modules/clustering.html
632
- Detailed overview of different clustering algorythms
632
+ Detailed overview of different clustering algorithms
633
633
Sklearn Examples outlier detection:
634
634
https://scikit-learn.org/stable/auto_examples/plot_anomaly_comparison.html
635
- Example of different used outlier detection algorythms
635
+ Example of different used outlier detection algorithms
636
636
"""
637
637
638
638
# pylint: disable = too-many-arguments, too-many-locals, too-many-branches
@@ -659,9 +659,9 @@ def group_betas(
659
659
betas = betas [inlier_index ]
660
660
beta_index = beta_index [inlier_index ]
661
661
else :
662
- empy_list = []
663
- beta_clusters .append (empy_list )
664
- id_clusters .append (empy_list )
662
+ empty_list = []
663
+ beta_clusters .append (empty_list )
664
+ id_clusters .append (empty_list )
665
665
666
666
detector = None
667
667
0 commit comments