algorithm - How to build up the observation array in Accord.NET using C# -
i'm trying learn ropes in accord.net , ai world... goal clustering list of customers using k-means algorithm. each customer, got 3 features:
customerid, productcategory, totqty, totamount aaa, 01, 50, 3000 aaa, 02, 10, 150 bbb, 01, 45, 2700 ...
now, have pass observations k-means algorithm:
double[][] observations = ... (?) // create new k-means algorithm kmeans kmeans = new kmeans(k: 10); // compute , retrieve data centroids var clusters = kmeans.learn(observations); // use centroids parition data int[] labels = clusters.decide(observations);
first question: have group data customer? this:
double[][] observation = { new double[] { 1, 50, 3000, 2, 10, 150 }, new double[] { 1, 45, 2700} }
or:
double[][] observation = { new double[] { 1, 50, 3000}, new double[] { 2, 10, 150}, new double[] { 1, 45, 2700} }
second question: how trace result original customerid? mean got result assigned label int[] labels = clusters.decide(observations);
how can determine customer belongs cluster/label?
i made generic k-means library c#
so can use second question. (after got centroid can objects belong centroid)
Comments
Post a Comment