Class: Rumale::Clustering::SNN
- Inherits:
-
DBSCAN
- Object
- Base::Estimator
- DBSCAN
- Rumale::Clustering::SNN
- Defined in:
- rumale-clustering/lib/rumale/clustering/snn.rb
Overview
SNN is a class that implements Shared Nearest Neighbor cluster analysis. The SNN method is a variation of DBSCAN that uses similarity based on k-nearest neighbors as a metric.
Reference
-
Ertoz, L., Steinbach, M., and Kumar, V., “Finding Clusters of Different Sizes, Shapes, and Densities in Noisy, High Dimensional Data,” Proc. SDM’03, pp. 47–58, 2003.
-
Houle, M E., Kriegel, H-P., Kroger, P., Schubert, E., and Zimek, A., “Can Shared-Neighbor Distances Defeat the Curse of Dimensionality?,” Proc. SSDBM’10, pp. 482–500, 2010.
Instance Attribute Summary
Attributes inherited from DBSCAN
Attributes inherited from Base::Estimator
Instance Method Summary collapse
-
#fit(x) ⇒ SNN
Analysis clusters with given training data.
-
#fit_predict(x) ⇒ Numo::Int32
Analysis clusters and assign samples to clusters.
-
#initialize(n_neighbors: 10, eps: 5, min_samples: 5, metric: 'euclidean') ⇒ SNN
constructor
Create a new cluster analyzer with Shared Neareset Neighbor method.
Methods included from Base::ClusterAnalyzer
Constructor Details
#initialize(n_neighbors: 10, eps: 5, min_samples: 5, metric: 'euclidean') ⇒ SNN
Create a new cluster analyzer with Shared Neareset Neighbor method.
29 30 31 32 33 34 35 36 |
# File 'rumale-clustering/lib/rumale/clustering/snn.rb', line 29 def initialize(n_neighbors: 10, eps: 5, min_samples: 5, metric: 'euclidean') # rubocop:disable Lint/MissingSuper @params = { n_neighbors: n_neighbors, eps: eps, min_samples: min_samples, metric: (metric == 'precomputed' ? 'precomputed' : 'euclidean') } end |
Instance Method Details
#fit(x) ⇒ SNN
Analysis clusters with given training data.
44 45 46 |
# File 'rumale-clustering/lib/rumale/clustering/snn.rb', line 44 def fit(x, _y = nil) super end |
#fit_predict(x) ⇒ Numo::Int32
Analysis clusters and assign samples to clusters.
53 54 55 |
# File 'rumale-clustering/lib/rumale/clustering/snn.rb', line 53 def fit_predict(x) # rubocop:disable Lint/UselessMethodDefinition super end |