Coder Social home page Coder Social logo

clustering's Introduction

Clustering

To run the program, see the Usage section at the end of the document.

Introduction

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.

Results

  1. Clustering_testdata/Clustering_test1

    • eps=0.25
    • min_samples=20
    • clusters: 4 (without noise) Clustering_test1
  2. Clustering_testdata/Clustering_test2

    • eps=0.20
    • min_samples=20
    • clusters: 4 (without noise) Clustering_test2
  3. Clustering_testdata/Clustering_test3

    • eps=0.23
    • min_samples=20
    • clusters: 5 (without noise) Clustering_test3 This dataset is a bit more complex than the previous two datasets. I've tried to find the optimal values for epsilon and min_samples. This is the best result I could get.
  4. Clustering_testdata/Clustering_test4

    • eps=0.26
    • min_samples=25
    • clusters: 2 (without noise)
    • Clustering_test4
  5. Clustering_testdata/Clustering_test5

    • eps=0.265
    • min_samples=20
    • clusters: 2 (without noise) Clustering_test5

Final Output Format

PNG file: {input_file}_output.png

The output file is a PNG file that shows the clusters. The clusters are shown in different colors.

text file: {input_file}_output.txt

The text file contains the following information:

eps: {epsilon}, min_samples: {min_samples}
X Y ClusterID

Usage

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)

Example

python nm6121030.py --input Clustering_testdata/Clustering_test2 --eps 0.25 --min_samples 20

clustering's People

Contributors

littlefish-coder avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.