mean shift algorithm it is another popular and powerful clustering algorithm used in unsupervised learning it does not make any assumptions hence it is non-parametric algorithm it is also called hierarchical clustering or mean shift cluster analysis followings would be the basic steps of this algorithmfirst of allwe need to start with the data points assigned to cluster of their own nowit computes the centroids and update the location of new centroids by repeating this processwe move closer the peak of cluster towards the region of higher density this algorithm stops at the stage where centroids do not move anymore with the help of following code we are implementing mean shift clustering algorithm in python we are going to use scikit-learn module let us import the necessary packagesimport numpy as np from sklearn cluster import meanshift import matplotlib pyplot as plt from matplotlib import style style use("ggplot"the following code will help in generating the two-dimensional datasetcontaining four blobsby using make_blob from the sklearn dataset package