Feedback

#1
by merve HF staff - opened
scikit-learn org

@NTaylor hello πŸ‘‹ thanks a lot! is it okay if you could add a bit of parameters on PCA & LDA if possible?

scikit-learn org
β€’
edited May 15, 2023

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?

scikit-learn org

@merve Please see the updated version and let me know of this seems suitable.

scikit-learn org

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/

scikit-learn org

Hi @merve , I will try to implement the changes you have suggested when I get a chance. I am hoping to get to this by the weekend, so watch this space. Apologies in advance if they do not happen in a timely fashion, am rather busy at the moment!

scikit-learn org

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.

scikit-learn org
β€’
edited May 31, 2023

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?

scikit-learn org
β€’
edited Jul 26, 2023

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 :)

Sign up or log in to comment