Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Clustering Using Mean Shift Algorithm in ML (Practical using MATLAB)



Code:

clc

clear all

close all

warning off

x=readtable('Mall_customers.csv');

x=table2array(x(:,4:5));

scatter(x(:,1),x(:,2),'filled')

[clustCent,idx,not_required] = MeanShiftCluster(x',25,0);

% numel(unique(idx))

gscatter(x(:,1),x(:,2),idx);

clustCent=clustCent';

hold on;

for i=1:5

    t=0:0.01:2*pi;

    x=clustCent(i,1)+cos(t);

    y=clustCent(i,2)+sin(t);

    fill(x,y,'k');

end

 

 

Join us on Telegram: https://t.me/matlabcastor

No comments

Popular Posts