@@ -77,7 +77,10 @@ def kMST(data, num_neighbors=3, min_samples=1, epsilon=None, umap_kwargs=None):
77
77
)
78
78
with warn .catch_warnings ():
79
79
warn .filterwarnings (
80
- "ignore" , category = UserWarning , module = "umap.umap_" , lineno = 2010
80
+ "ignore" ,
81
+ category = UserWarning ,
82
+ module = "umap.umap_" ,
83
+ message = ".*is not an NNDescent object.*" ,
81
84
)
82
85
umap = UMAP (
83
86
n_neighbors = mst_indices .shape [1 ],
@@ -133,7 +136,9 @@ class KMST(BaseEstimator):
133
136
missing values. Use the graph_ and embedding_ attributes instead!
134
137
"""
135
138
136
- def __init__ (self , * , num_neighbors = 3 , min_samples = 1 , epsilon = None , umap_kwargs = None ):
139
+ def __init__ (
140
+ self , * , num_neighbors = 3 , min_samples = 1 , epsilon = None , umap_kwargs = None
141
+ ):
137
142
self .num_neighbors = num_neighbors
138
143
self .min_samples = min_samples
139
144
self .epsilon = epsilon
@@ -173,9 +178,7 @@ def fit(self, X, y=None, **fit_params):
173
178
clean_data = X
174
179
175
180
kwargs = self .get_params ()
176
- self .mst_indices_ , self .mst_distances_ , self ._umap = kMST (
177
- clean_data , ** kwargs
178
- )
181
+ self .mst_indices_ , self .mst_distances_ , self ._umap = kMST (clean_data , ** kwargs )
179
182
self .graph_ = self ._umap .graph_ .copy ()
180
183
self .embedding_ = (
181
184
self ._umap .embedding_ .copy () if hasattr (self ._umap , "embedding_" ) else None
0 commit comments