-
Notifications
You must be signed in to change notification settings - Fork 92
Can I i have an identification item that can be ignored by clusterfck.kmeans #4
Comments
You don't need this as you can set arbitrary properties on a javascript array. For example: var colors = [
[20, 20, 80],
[22, 22, 90],
[250, 255, 253],
[0, 30, 70],
[200, 0, 23],
[100, 54, 100],
[255, 13, 8]
];
colors.forEach(function(color, i) {
//Set id for tracking purposes
color.id = i;
});
clusterfck.kmeans(colors, 3); |
I think @benjeffery's method would work fine all the way. A more obvious method would be ideal though, something like: var colors = [
{ id: "blue", value: [0, 0, 255] },
{ id: "orange", value: [200, 50, 50] }
] where This would also allow you to use |
Have you made any performance tests using a Float64Array? This could be very interesting. |
HI @harthur how do I use your above construct var colors = [
{ id: "blue", value: [0, 0, 255] },
{ id: "orange", value: [200, 50, 50] }
] Do I still do clusterfck.kmeans(colors, 3); This is not working as expected this way. |
The example @harthur gave was how things might work if such a mechanism was implemented. It hasn't been, so you need to something like I suggested above. |
For example the first item is an identification item ( userid ) so that I can know who went in wich cluster.
If I run this it just hungs. Is there a way to ignore the first item, and just consider the rest?
Thanks
The text was updated successfully, but these errors were encountered: