Clustering is generally techniques for finding subgroups, or clusters in a given dataset. When we cluster the observations of a data set, our aim is to partition the data into distinct groups so that the observations within each group are more or less similar to each other, while observations in…