To run the program, see the Usage section at the end of the document.
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a clustering algorithm that groups together points that are closely packed together. It is also able to identify points that are outliers. The algorithm works by grouping together points that are within a certain distance of each other. The algorithm has two parameters: epsilon and minPts. Epsilon is the maximum distance between two points for them to be considered as in the same cluster. minPts is the minimum number of points required to form a cluster.
-
Clustering_testdata/Clustering_test1
-
Clustering_testdata/Clustering_test2
-
Clustering_testdata/Clustering_test3
-
Clustering_testdata/Clustering_test4
-
Clustering_testdata/Clustering_test5
The output file is a PNG file that shows the clusters. The clusters are shown in different colors.
The text file contains the following information:
eps: {epsilon}, min_samples: {min_samples}
X Y ClusterID
clone the repository and run the following command in the terminal:
git clone https://github.com/LittleFish-Coder/clustering.git
cd clustering
python nm6121030.py
add arguments to the command line to change the default values of the program.
--input
to change the input file (default: Clustering_testdata/Clustering_test1)--eps
to change the epsilon value (default: 0.20)--min_samples
to change the min_samples value (default: 20)
python nm6121030.py --input Clustering_testdata/Clustering_test2 --eps 0.25 --min_samples 20