Selecting data subsets from DataShader

This might have been answered before, but I can’t seem to find a good post/tutorial/documentation.

I have a large dataset of ship positions that I’m running through an classification algorithm to predict the vessel class. I’m working on a Panel-app to quickly swap out datasets, pre-trained models, classification labels etc. I then plot algorithm performance and would also like to plot things like SHAP decision making for specific samples. Here’s a screen shot of a work-in-progress:

It seems that I can’t select individual data points using datashader (makes sense, I’m looking at an aggregate displayed on the map). But it would be useful to be able to get information on all data points that fall within the current window, or that are selected by a box draw tool.

I’d like to be able to zoom into a region, update the Confusion Matrix and Classification Report to see how the algorithm performance changes for different regions.

Any ideas on the correct way to do this or a nice example that does something similar?

Nice!

Maybe Exploring AIS vessel-traffic data — Examples 0.1.0 documentation

And soon to be released:

I had some trouble getting that ship example to run; my dask dataset just maxed out the cpu and memory on the “load_data” step. This was both with processing from raw CSV or downloading the preprocessed parquet file from the amazon bucket. I’m guessing it might be a difference in dask versions or parquet libs.

Also it’s not really clear WHAT is happening to allow clicking on the aggregated data to get an underlying point. It looks like another layer is being added with “vessel_name_raster” which is catagorised by the vessel ID number, (that might result in tens of thousands of catagories with a mid-sized AIS dataset) and then made transparent. That seems a little roundabout to just getting the lat/lon of a click or the bounding box of the window and then doing a look up on the dataframe.

It looks like there might be the right tool for the job described here:

https://panel.holoviz.org/tutorials/basic/build_crossfilter_dashboard.html