K-Means Clustering Hands-on

Introduction 



K-Means clustering is a popular unsupervised machine learning algorithm that is used to group data into clusters based on similarity. The goal of K-Means is to partition n observations into k clusters, where each observation belongs to the cluster with the nearest mean.


FORMULA:




where,

"||xi - vj||" is the Euclidean distance between xi and vj.

"ci" is the number of data points in ith clusters. 

"c" is the number of cluster centers. 


Code : 

Step 1- Importing Dependencies

 import pandas as pd

import numpy as np 
import matplotlib.pyplot as plt


from sklearn.datasets import load_iris

 



Comments

Popular posts from this blog

Convolutional Neural Network

MLOP's