Skip to content

Conversation

@scarlettjclark
Copy link

@scarlettjclark scarlettjclark commented Jan 4, 2022

Made a new example that visualises the machine learning technique of k means clustering on the Christmas tree and added the code that was used to generate it to the readme file.

K means clustering is a machine learning technique that attempts to split data into clusters. It's output is k "centroids" that can be used to decide what group future data is in by measuring which centroid is closest. This visualisation takes the group assignment of each light on the tree at each iteration of the algorithm and colours them accordingly, and colours the lights that are closest to the current position of the centroid in a different colour. It, by default, provides a visualisation of k=2, 3, 5 and 7. The associated github repo has code that allows different ks to be given, different colours to be used for the clusters and centres, and for the speed of the animation to be adjusted.

Made a new example that visualises the machine learning technique of k means clustering on the Christmas tree and added the code that was used to generate it to the readme file.
@d-albrecht
Copy link
Contributor

Hey, I couldn't confirm your animation because the two simulators that I tried so far were too picky on the format. Because (a) one line number (at least) isn't as expected "Skipping frames not supported (Line 106, expected frame number 104, got 1)" (on simulator #26 ) and (b) you forgot the last LED, your header ends with R_498,G_498,B_498 when there should be a 499th triple (where at least #11 resulted in no activated lights at all).

I know I should remember k means clustering. But ML isn't my strength so I forgot almost all of that already.

Fixed bugs in the linked code where it'd drop the first entry in the coords file and the steps of the sequence wouldn't be sequential, then used the code to generate a new csv file. Thanks @d-albrecht
@d-albrecht
Copy link
Contributor

Thanks for the fix, now it's working and it looks just as expected. As I commented to another PR, it is awesome to see this work out in 3D when most of the time those ideas are taught in 2D only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants