mattnedrich / MeanShift_py

Simple implementation of mean shift clustering in python
MIT License
293 stars 100 forks source link

Mean Shift to Generate Images #5

Closed fullstackman closed 7 years ago

fullstackman commented 7 years ago

I would like to generate images (like "ms_2dbw.8.gif"), but I don't see anything image related in the source code. Where/how did you get those images?

mattnedrich commented 7 years ago

I used seaborn to generate images for each iteration, and then converted them into gifs. I believe I used kdeplot specifically.

My code has an iteration_callback function that you can pass into cluster. This function will be called each iteration with the current location for the points (as they shift toward the mean during each iteration). So conceptually, you can use seaborn.kdeplot to plot the kde surface, then provide an iteration_callback and plot the points during each iteration to reproduce the gifs that I created.

fullstackman commented 7 years ago

Thank you. I will look into it.