Code Monkey home page Code Monkey logo

kmeans-clustering-cpp's Introduction

K-Means clustering in C++

Binary build

This is a C++ implementation of the simple K-Means clustering algorithm.

K-means clustering is a type of unsupervised learning, which is used when you have unlabeled data (i.e., data without defined categories or groups). The goal of this algorithm is to find groups in the data, with the number of groups represented by the variable K. The algorithm works iteratively to assign each data point to one of K groups based on the features that are provided. Data points are clustered based on feature similarity.

This implementation now contains multithreading support, which speeds up calculations for large vectors and thousands of points by parallelization.

Instructions:

The input supports any number of points and any number of dimensions. Make the "input.txt" file accordingly.

  • Download the binary file "kmeans" from the repository.
  • Make a file "input.txt" with all the point coordinates. The format should be as shown below (the example has 2-dimensional coordinates):

Input File Syntax

  • Run the kmeans binary with the input file name, number of clusters and output directory as command line arguments

Run this command : ./kmeans input.txt 2 cluster-details

Output : Bash Output

  • The output will be 2 files in the output directory (eg: cluster-details) which contains the center point of each cluster, and cluster detail for each point.

Clusters File Syntax


kmeans-clustering-cpp's People

Contributors

aditya1601 avatar github-actions[bot] avatar anuradhawick avatar arpitparmar5739 avatar anebot 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.