Commit
·
89da9e7
1
Parent(s):
239a99b
Suggested modifications
Browse files
app.py
CHANGED
@@ -80,6 +80,8 @@ with gr.Blocks(title=title) as demo:
|
|
80 |
on a synthetic dataset. The transformations are then used to train a linear model on the \
|
81 |
transformed data. The plot shows the ROC curve of the different models trained on the \
|
82 |
transformed data. The plot is interactive and you can zoom in and out.
|
|
|
|
|
83 |
"""
|
84 |
)
|
85 |
|
@@ -88,10 +90,10 @@ with gr.Blocks(title=title) as demo:
|
|
88 |
n_samples = gr.inputs.Slider(50_000, 100_000, 1000, label="Number of Samples", default=80_000)
|
89 |
n_estimators = gr.inputs.Slider(10, 100, 10, label="Number of Estimators", default=10)
|
90 |
max_depth = gr.inputs.Slider(1, 10, 1, label="Max Depth", default=3)
|
|
|
91 |
plot = gr.Plot(label="ROC Curve")
|
92 |
|
93 |
-
|
94 |
-
Reduction.click(fn=app_fn, inputs=[n_samples, n_estimators, max_depth], outputs=[plot])
|
95 |
demo.load(fn=app_fn, inputs=[n_samples, n_estimators, max_depth], outputs=[plot])
|
96 |
|
97 |
demo.launch()
|
|
|
80 |
on a synthetic dataset. The transformations are then used to train a linear model on the \
|
81 |
transformed data. The plot shows the ROC curve of the different models trained on the \
|
82 |
transformed data. The plot is interactive and you can zoom in and out.
|
83 |
+
|
84 |
+
[Original Example](https://scikit-learn.org/stable/auto_examples/ensemble/plot_feature_transformation.html#sphx-glr-auto-examples-ensemble-plot-feature-transformation-py)
|
85 |
"""
|
86 |
)
|
87 |
|
|
|
90 |
n_samples = gr.inputs.Slider(50_000, 100_000, 1000, label="Number of Samples", default=80_000)
|
91 |
n_estimators = gr.inputs.Slider(10, 100, 10, label="Number of Estimators", default=10)
|
92 |
max_depth = gr.inputs.Slider(1, 10, 1, label="Max Depth", default=3)
|
93 |
+
btn = gr.Button("Run")
|
94 |
plot = gr.Plot(label="ROC Curve")
|
95 |
|
96 |
+
btn.click(fn=app_fn, inputs=[n_samples, n_estimators, max_depth], outputs=[plot])
|
|
|
97 |
demo.load(fn=app_fn, inputs=[n_samples, n_estimators, max_depth], outputs=[plot])
|
98 |
|
99 |
demo.launch()
|