Git Product home page Git Product logo

k-means's Introduction

The following is the code for K-Means clustering with :

1)Euclidean distance
2)Manhattan distance
3)Cosine similarity

as the distances. Choosing which distance to use is up to the user. L2 normalization has also been implemented.

Regeardless of what the user chooses, the program will run with the value of k ranging from 1-10. Following which a graph will be shown as the output. The graph shows the relation between the number of clusters and the value of precision, recall and f-score.

To choose a particular distance and whether or not l2 normalization should be applied, please follow the commands on screen and enter the appropriate value.

The following are the external libraries used in the code along with their purpose: 1)Numpy - used for l2 normalization, basic arrays and their operation and for initializing the centroids with random values. 2)Matplotlib - used for plotting the relationship between the number of clusters and the precision, recall and f-score

Disclaimer - Since the initial points of the centroids are chosen at random, exact results may vary. The graph generally shows a similar relation between the number of clusters and precision, recall and f-score. If a cluster is empty, the precision is taken as 1.

k-means's People

Contributors

shubham0831 avatar namanlashkari avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

namanlashkari

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.