Feedback
I can try, will maybe use n_components and allow selection of sub features as parameters - however as this is a 2-D visualisation for PCA/LDA the number of components seems relatively fixed to 2 - and not sure number of samples makes much sense. Not too sure what parameters make most sense to use here. Any suggestions would be great?
hey @NTaylor I think it looks way better, and I feel like it would be even better if you'd replace the Run button with event listener on each slider instead, WDYT?
See an example in second code snippet here: https://gradio.app/blocks-and-event-listeners/
Hi @merve . So I just got a few mins to try out using even listeners - and it works, although is problematic in that it ends up creating the plot for each slider now. I will try figure that out, but if you have any tips or examples for using multiple variables linked to just one plot function - that would be great.
Hey @NTaylor no worries! From your code, I only see one function to plot something.
n_samples.change(plot_lda_pca, inputs = [n_samples, n_features], outputs= gr.Plot(label='PCA vs LDA clustering') ) #
n_features.change(plot_lda_pca, inputs = [n_samples, n_features], outputs= gr.Plot(label='PCA vs LDA clustering') ) #
Better pattern is to create two separate functions and call change on each event listener and pass the individual function IMHO. WDYT?
Sorry for the huge delay on this - have been swamped. It is on my todo list. But your suggestion sounds smart, and I will try find time to implement :)