Git Product home page Git Product logo

manual-kmeans-clustering-v1's Introduction

Manual Kmeans Clustering #1

This program implements the K-means clustering algorithm without built in functions implementing raw K-Means algorithm of how actually K-Means work in the backend. The program clusters the data into K=2 groups and visualizes the clusters using a scatter plot with different colors for each cluster.

Dataset

The dataset is read from an Excel file (Data.csv) using the pandas library. Make sure the file path is correctly specified in the code.

Algorithm

The K-means clustering algorithm is implemented using the provided code. The algorithm follows these steps:

  1. Initialize the centroids for the clusters.
  2. Assign each data point to the nearest centroid based on the Euclidean distance.
  3. Calculate the mean of the points in each cluster and update the centroids.
  4. Repeat steps 2 and 3 until the centroids no longer change.

Screenshots

image

Dependencies

  • Python 3.x
  • Pandas
  • Matplotlib

Please ensure you have these dependencies installed before running the program.

Usage

  1. Make sure the Data.csv file is in the same directory as the script, or specify the correct file path in the code.
  2. Run the script using Python.
  3. The program will perform K-means clustering on the dataset and display the scatter plot with the clusters.
python main.py

manual-kmeans-clustering-v1's People

Contributors

saadarazzaq 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.