Added even listeners for sliders - although each makes own plot now.
Browse files
app.py
CHANGED
@@ -92,7 +92,6 @@ def plot_lda_pca(n_samples = 50, n_features = 4):
|
|
92 |
|
93 |
return fig
|
94 |
|
95 |
-
|
96 |
title = "2-D projection of Iris dataset using LDA and PCA"
|
97 |
with gr.Blocks(title=title) as demo:
|
98 |
gr.Markdown(f"# {title}")
|
@@ -117,8 +116,7 @@ with gr.Blocks(title=title) as demo:
|
|
117 |
|
118 |
n_features = gr.Slider(value=2, minimum=2, maximum=max_features, step=1, label="n_features")
|
119 |
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
|
124 |
demo.launch()
|
|
|
92 |
|
93 |
return fig
|
94 |
|
|
|
95 |
title = "2-D projection of Iris dataset using LDA and PCA"
|
96 |
with gr.Blocks(title=title) as demo:
|
97 |
gr.Markdown(f"# {title}")
|
|
|
116 |
|
117 |
n_features = gr.Slider(value=2, minimum=2, maximum=max_features, step=1, label="n_features")
|
118 |
|
119 |
+
n_samples.change(plot_lda_pca, inputs = [n_samples, n_features], outputs= gr.Plot(label='PCA vs LDA clustering') ) #
|
120 |
+
n_features.change(plot_lda_pca, inputs = [n_samples, n_features], outputs= gr.Plot(label='PCA vs LDA clustering') ) #
|
|
|
121 |
|
122 |
demo.launch()
|