Thanks for your great work.
from sklearn.cluster import MeanShift
data = np.loadtxt("test.csv", delimiter=",")
cluster = MeanShift(bandwidth=1).fit(data)
This code outputs 30 clusters. However, your C++ outputs 13 clusters (with the same float bandwidth = 1.0;). If I set bandwidth=0.45 in your code, it outputs 30 clusters but the cluster center of sklean and your code are not identical.
Number of points: 85
Number of dimensions: 2
Number of clusters: 13
Elapsed time: 0.0038222 s
Data is given below.
3.194799644708685271e+00,1.399483126857062487e+01
3.658620824564967400e+00,7.998179031752796320e+00
2.406295091169551537e+00,1.371293923319686137e+01
6.455143433800709651e+00,1.332078919555413599e+01
6.639544003222972002e+00,-9.784779332706614596e-01
4.683512497858520085e+00,1.533389839307644564e+01
3.030875878761376985e+00,7.453306804175237943e+00
5.434090247273947405e+00,1.414049843741694978e+01
3.679344315396408938e+00,1.467462112161013366e+01
7.768518143283098532e+00,1.332199924661608215e+01
-2.319508287202100227e+00,2.477186757495290603e+00
1.074944778405868995e+00,9.340254026825610012e+00
6.894037470483292296e+00,7.581186678942872237e-02
4.844635093320603936e+00,1.203458719558798506e+01
-2.795300513931746611e+00,2.471883609154136963e+01
7.915733620177003438e-01,1.721061193132751299e+01
7.132313391239341271e+00,1.550459686982297214e+01
8.515816767482528249e+00,1.065819225023263783e+01
8.978747615487289169e-01,1.043591726019572619e+01
5.546071571953522295e+00,1.562121487999592873e+01
4.065270136084711439e+00,1.583814811578007919e+01
3.184036959812714535e-02,1.459321007541508486e+01
-1.244543671389629180e+00,1.743108984169777287e+01
6.390077321532942278e+00,6.840997324649358280e-01
8.147730609299953741e+00,1.365558937915167270e+01
6.047264590048973432e+00,1.368315895680113492e+01
-2.237954885311399078e+00,1.097428962799293295e+01
4.112337877847533463e+00,1.498296194188718644e+01
6.093217411552747542e+00,1.521741446097545669e+01
3.519516426117108576e+00,1.717652937955963210e+01
7.717618815028292723e+00,1.418862816020948969e+01
7.072528949742961091e-01,1.730178780786865644e+01
6.956095223985222731e+00,1.571501162530448958e+01
2.886951082285038162e+00,1.447572078353684866e+01
2.435018839978735805e+00,1.643058716302973465e+01
5.557089553165287299e+00,1.500259061064638999e+01
1.966322507606136361e+00,1.471772285493714350e+01
3.591336047378127727e+00,1.466238736293894718e+01
8.106564362560180204e-01,1.022956186631088826e+01
2.730131991988756557e+00,8.081727808511182332e+00
6.753675108425203355e+00,1.714773673301615631e+01
4.860962701368696237e+00,1.501714466415207205e+01
3.461255980400441246e+00,8.426995794166828091e+00
5.089684241933406739e+00,4.213103664488715872e+00
6.459589772973727939e+00,1.351150064898626724e+01
3.682710121593864905e+00,7.784238822473763975e+00
6.519441637177784798e+00,1.751059074617726363e+00
8.519958784130727381e+00,1.063034061040542433e+01
-2.271280185668279383e+00,3.879749441538207666e+00
-2.782982246156696871e+00,2.261527601462014925e+00
6.848669350998769723e+00,-3.300827752221471845e-01
-1.947588058896889684e+00,-3.393087653162231709e-01
-2.191119170120348958e+00,-2.343437401262641107e+00
7.712764907854805507e+00,1.319482344711862432e+01
5.797760047057320065e+00,1.509748037202986382e+01
-2.053737638193722237e+00,1.750538842583448940e+00
8.122384948222315160e+00,1.379717402367879231e+01
-2.545057085277153242e+00,-3.696450699828900399e-01
8.778814720324358278e-01,9.700049742821180487e+00
4.693773419951842385e+00,1.236804175668522809e+01
6.603024160919162000e+00,1.519063647432190933e+01
6.402927408401876797e+00,-6.310552586436059208e+00
5.448012673099911218e+00,1.449952116547625280e+01
-1.946289969373644624e+00,-4.386493878635892574e-01
-2.290784283403446420e+00,-1.068402841612288823e+00
-2.145998628910888328e+00,-2.420282125602403411e+00
-2.210651295857830156e+00,2.539023175221418516e+00
-2.368403256205440677e+00,-1.843572973551060423e+00
-2.313993176597985535e+00,1.113922159618876506e+01
5.304183496810864540e+00,1.597518979504664260e+00
7.358031045789820146e-01,9.957558811225338147e+00
2.320085637716873261e+00,7.920250745862526642e+00
1.921114181617376238e+00,1.656865295717014064e+01
8.308942694396936446e+00,7.175072308496275308e-01
8.290689221475529891e+00,3.117030130446184266e+00
5.969739229591654706e+00,1.490792651282334980e+01
4.392748810510084922e+00,2.552749483389695939e+01
4.424134938057694200e+00,1.361148649320027637e+01
-2.016840179546761647e+00,9.798201658621681354e-01
3.835888263461657122e+00,7.994134963339781130e+00
-6.620268053846491974e-01,1.697437277727217975e+01
2.967707110665201764e+00,7.958832455032286646e+00
-2.193787919297927047e+00,3.106307822680461239e+00
1.022181997007836962e+00,1.038669874254246928e+01
2.674588284866549426e+00,1.395835657759778314e+01
Thanks for your great work.
Could you help me configure parameters in your code to match
sklearn.cluster.MeanShift scikit-learn 0.21.1output?This code outputs 30 clusters. However, your C++ outputs 13 clusters (with the same
float bandwidth = 1.0;). If I setbandwidth=0.45in your code, it outputs 30 clusters but the cluster center ofskleanand your code are not identical.I think, it is better to set
clusterEpsscalable to bandwidth rather than fix it in this line.Data is given below.