python-streamz / streamz

Real-time stream processing for python
https://streamz.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1.24k stars 148 forks source link

RiverML: update the plots less frequently #446

Closed maximlt closed 2 years ago

maximlt commented 2 years ago

Instead of using hvplot I've directly used holoviews and DynamicMaps and Pipes. I've partitioned the observations and clusters and concatenated them to send them only every X events. Running the script with viz=True I get a refresh rate of about 50 Hz for a cadence of 100 Hz, while I get an output at about 70 Hz without any viz (same cadence).

martindurant commented 2 years ago

Thanks very much, good to see! We should make this example more prominent, right?

maximlt commented 2 years ago

Yes why not! It's an interesting and powerful application of streamz+holoviews. The question is, where? @jbednar any recommendation? This is what the example looks like (running the river_kmeans.py script with viz=True):

riverml_streamz_example

jbednar commented 2 years ago

Maybe link from examples.pyviz?

maximlt commented 2 years ago

Maybe this should just be a proper example on examples.pyviz.org

@martindurant would you be interested in writing a notebook that introduces streamz and its support of RiverML, and the example (online k-means clustering)? If so, I could take care of polishing the plot and publishing the example on examples.pyviz.org (creating the anaconda-project and deploying it on AE5).