Skip to content

sayuru-akash/kmeans-clustering-matlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues GPL License LinkedIn


Logo

Kmeans Clustering and Figures in MATLAB

An simple implementation of Kmeans Unsupervised Learning Algorithm in MATLAB
Explore the project »

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. Contributors
  6. License
  7. Contact

About The Project

Product Name Screen Shot

(back to top)

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

This project is built using MATLAB. You will need to have it installed on your machine and have Statistics and Machine Learning Toolbox pre-installed in it.

Installation

  1. Get MATLAB running on your machine.
  2. Clone the repo and resolve dependencies, if any
    git clone https://github.com/sayuru-akash/kmeans-clustering-matlab.git
  3. Place the project in the application folder
  4. Run the project

(back to top)

Usage

This project can be used to understand the Kmeans Clustering Algorithm and how it works. It can also be used to generate figures using MATLAB.

Task 1 – Data Preparation

  1. DATA: To get data for K means clustering, you use MATLAB code “gen_clusterdata”. This code generates your personal data matrix. Use MATLAB command: X=gen_clusterdata(ID), where ID is your student number. The code generates a data matrix X of four columns representing features and N rows representing objects (cases).
  2. Data analysis.
  • Report N - the total number of rows (objects, cases) in your data.
  • For each column (feature) from 1 to 4 report: the mean, the standard deviation and the histogram.
  • Report the covariance matrix (4x4) and the correlation matrix (4x4).

Task 2.2 – K Means Clustering

  1. Given the number of clusters as 3(i.e.,K=3),implement Kmeans clustering and then repeat the same procedure (i.e., use iteration) to evaluate different number of clusters (i.e., K=3, 4, and 5) to find out the optimal number of classes that achieve the best performance.
  2. For each K value, report the mean performance using the Silhouette measure and plot the Silhouette for each cluster. (each K value)
  3. What is the stopping criteria for Kmeans clustering? Plot the clusters and the cluster centroids.
  4. Report the best K value using the Silhouette measure and the corresponding cluster centroids.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contributors

This project is an academic project done on 2023 and is contributed by

License

Distributed under the GPL-3.0 License. See LICENSE for more information.

(back to top)

Contact

Sayuru Akash - @sayuru_akash - contact@sayuru.me

Project Link: https://github.com/sayuru-akash/kmeans-clustering-matlab

(back to top)

About

Implement Kmeans Clustering Algorithm with generating figures and analysing performance using MATLAB.

Topics

Resources

License

Stars

Watchers

Forks

Languages