Skip to content

K-Means Clustering Algorithm experimented on the famous iris dataset

Notifications You must be signed in to change notification settings

adityagandhamal/clustering-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

About Project

In this project, I have done an experiment with K-Means Clustering Algorithm (or Unsupervised Machine Learning) on the famous iris dataset. As we know, the iris dataset has 3 target labels viz. iris setosa, iris versicolor and iris virginica labeled as 0, 1 and 2 respectively, I have given the clustering algorithm only the features of the iris dataset to get the predicted labels and to compare with the true ones.

Data Used

The data used is the iris dataset available in the sklearn library itself. I have worked with only the petal features(length and width) in this experiment.

Model training and predictions

I have trained the model(KMeans) with the data and have plotted the predictions along with their predicted labels(using colors as the respective clusters) with the help of Matplotlib.

Plot depicting the training data.

Screenshot (9)

Plot depicting the predictions on the same data using K-Means Clustering Algorithm.

Screenshot (6)

Further improvements

I have applied the Elbow Method to find out the optimum value for n_clusters and further even scaled down the features using MinMaxScaler.

Elbow Method to determine the optimum value for n_clusters

Screenshot (8)

Libraries Used

  • SciKit Learn
  • Numpy
  • Matplotlib

About

K-Means Clustering Algorithm experimented on the famous iris dataset

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published