close
The Wayback Machine - https://web.archive.org/web/20200915013823/https://github.com/felipeangelimvieira/SharedNearestNeighbors
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SharedNearestNeighbors

A Shared Nearest Neighbors (Jarvis-patrick) clustering implementation. This code is basically a wrapper of sklearn DBSCAN, implementing the neighborhood similarity as a metric.

Examples

The implementation follows the syntax of scikit-learn clustering classes. See example notebook for more information.

from SNN import SharedNearestNeighbor as SNN
X = np.random.rand(100,2)
snn = SNN(n_neighbors = 40,eps = 32, min_samples = 10)
y_pred = snn.fit_predict(X)

Image

snn = SNN(n_neighbors = 35,eps = 25, min_samples = 8)
y_pred = snn.fit_predict(X)

Image

snn = SNN(n_neighbors = 160,eps = 120, min_samples = 30)
y_pred = snn.fit_predict(X)

Image

snn = SNN(n_neighbors = 160,eps = 120, min_samples = 35)
y_pred = snn.fit_predict(X)

Image

snn = SNN(n_neighbors = 4, eps = 2, min_samples = 2)
y_pred = snn.fit_predict(X)

Image

snn = SNN(n_neighbors = 15, eps = 7, min_samples = 12)
y_pred = snn.fit_predict(X)

Image

To-do list

  • Add weighted option for similarity between neighbors

References

Jarvis, R. A., & Patrick, E. A. (1973). Clustering using a similarity measure based on shared near neighbors. IEEE Transactions on computers, 100(11), 1025-1034.

Ertöz, Levent, Michael Steinbach, and Vipin Kumar. "Finding clusters of different sizes, shapes, and densities in noisy, high dimensional data." Proceedings of the 2003 SIAM international conference on data mining. Society for Industrial and Applied Mathematics, 2003.

About

A Shared Nearest Neighbors clustering implementation. This code is basically a wrapper of sklearn DBSCAN, implementing the neighborhood similarity as a metric.

Topics

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.