@@ -98,8 +98,8 @@ def _brute_mst(mutual_reachability, min_samples):
98
98
Returns
99
99
-------
100
100
mst : ndarray of shape (n_samples - 1,), dtype=MST_edge_dtype
101
- The MST representation of the mutual-reahability graph. The MST is
102
- represented as a collecteion of edges.
101
+ The MST representation of the mutual-reachability graph. The MST is
102
+ represented as a collection of edges.
103
103
"""
104
104
if not issparse (mutual_reachability ):
105
105
return mst_from_mutual_reachability (mutual_reachability )
@@ -139,8 +139,8 @@ def _process_mst(min_spanning_tree):
139
139
Parameters
140
140
----------
141
141
min_spanning_tree : ndarray of shape (n_samples - 1,), dtype=MST_edge_dtype
142
- The MST representation of the mutual-reahability graph. The MST is
143
- represented as a collecteion of edges.
142
+ The MST representation of the mutual-reachability graph. The MST is
143
+ represented as a collection of edges.
144
144
145
145
Returns
146
146
-------
@@ -654,7 +654,7 @@ def __init__(
654
654
alpha = 1.0 ,
655
655
algorithm = "auto" ,
656
656
leaf_size = 40 ,
657
- n_jobs = 4 ,
657
+ n_jobs = None ,
658
658
cluster_selection_method = "eom" ,
659
659
allow_single_cluster = False ,
660
660
store_centers = None ,
@@ -721,10 +721,10 @@ def fit(self, X, y=None):
721
721
722
722
# Samples with missing data are denoted by the presence of
723
723
# `np.nan`
724
- missing_index = list ( np .isnan (reduced_X ).nonzero ()[0 ])
724
+ missing_index = np .isnan (reduced_X ).nonzero ()[0 ]
725
725
726
726
# Outlier samples are denoted by the presence of `np.inf`
727
- infinite_index = list ( np .isinf (reduced_X ).nonzero ()[0 ])
727
+ infinite_index = np .isinf (reduced_X ).nonzero ()[0 ]
728
728
729
729
# Continue with only finite samples
730
730
finite_index = _get_finite_row_indices (X )
@@ -834,7 +834,7 @@ def fit(self, X, y=None):
834
834
self ._single_linkage_tree_ ,
835
835
internal_to_raw ,
836
836
# There may be overlap for points w/ both `np.inf` and `np.nan`
837
- non_finite = set (infinite_index + missing_index ),
837
+ non_finite = set (np . hstack ([ infinite_index , missing_index ]) ),
838
838
)
839
839
new_labels = np .empty (self ._raw_data .shape [0 ], dtype = np .int32 )
840
840
new_labels [finite_index ] = self .labels_
0 commit comments