spamosaic.MNN.nn
- spamosaic.MNN.nn(ds1, ds2, names1, names2, knn=50, metric_p=2)[source]
Exact nearest-neighbor search using scikit-learn.
- Parameters:
ds1 (np.ndarray) – Query dataset of shape
(N1, D).ds2 (np.ndarray) – Reference dataset of shape
(N2, D).names1 (list of str) – Identifiers for rows in
ds1.names2 (list of str) – Identifiers for rows in
ds2.knn (int) – Number of nearest neighbors to retrieve for each query.
metric_p (int) – Minkowski distance parameter (e.g.,
2for Euclidean).
- Returns:
Set of matched nearest-neighbor pairs.
- Return type:
set[tuple[str, str]]