This content has been marked as final.
Show 3 replies

1. Re: Return specific cluster belong to new data set (kmeans using R)
diego.medrano Sep 9, 2016 5:03 PM (in response to Hardi Saputra)Hey Hardi,
What was the post you used to try to find a solution to this? It's possible we could tweak their solution to apply here.
Diego

2. Re: Return specific cluster belong to new data set (kmeans using R)
Bora Beran Sep 11, 2016 11:46 PM (in response to Hardi Saputra)You don't need to calculated distances yourself to do this. You can run kmeans again on the new data by initializing with the known centers.
SCRIPT_REAL(
'set.seed(.arg6[1]);
num.k= .arg5[1];
data=data.frame(.arg1,.arg2,.arg3,.arg4);
cl = kmeans(data,num.k);
x = c(.arg7,.arg8,.arg9,.arg10);
result<kmeans(x, num.k, centers=cl$center, iter.max=1);
result$cluster
',
SUM([Holiday Type Value]),SUM([NumberOfPersons]),SUM([Season Value]),SUM([Price]),[Number of K],[Seed],[Filter Holiday Type],[Filter Number of Persons],[Filter Season],[Filter Price])

3. Re: Return specific cluster belong to new data set (kmeans using R)
Hardi Saputra Sep 27, 2016 3:12 AM (in response to Bora Beran)1 of 1 people found this helpfulHi Bora,
Thank you for your solution. It solves my problem.