EduardoPach
commited on
Commit
·
b1d8269
1
Parent(s):
fade4ac
Suggested modifications
Browse files
app.py
CHANGED
|
@@ -81,11 +81,14 @@ with gr.Blocks() as demo:
|
|
| 81 |
Then it averages the individual predictions to form a final prediction. This example will use three different regressors to \
|
| 82 |
predict the data: GradientBoostingRegressor, RandomForestRegressor, and LinearRegression. Then the 3 regressors will be used for the VotingRegressor. \
|
| 83 |
The dataset used consists of 10 features collected from a cohort of diabetes patients. The target is a quantitative measure of disease progression one year after baseline.
|
|
|
|
|
|
|
| 84 |
"""
|
| 85 |
)
|
| 86 |
n = gr.inputs.Slider(10, 30, 5, 20, "Number of training samples")
|
| 87 |
-
plot = gr.Plot(label="Individual & Voting Predictions")
|
| 88 |
button = gr.Button(label="Update Plot")
|
|
|
|
|
|
|
| 89 |
button.click(fn=app_fn, inputs=[n], outputs=[plot])
|
| 90 |
demo.load(fn=app_fn, inputs=[n], outputs=[plot])
|
| 91 |
|
|
|
|
| 81 |
Then it averages the individual predictions to form a final prediction. This example will use three different regressors to \
|
| 82 |
predict the data: GradientBoostingRegressor, RandomForestRegressor, and LinearRegression. Then the 3 regressors will be used for the VotingRegressor. \
|
| 83 |
The dataset used consists of 10 features collected from a cohort of diabetes patients. The target is a quantitative measure of disease progression one year after baseline.
|
| 84 |
+
|
| 85 |
+
[Original example](https://scikit-learn.org/stable/auto_examples/ensemble/plot_voting_regressor.html#sphx-glr-auto-examples-ensemble-plot-voting-regressor-py)
|
| 86 |
"""
|
| 87 |
)
|
| 88 |
n = gr.inputs.Slider(10, 30, 5, 20, "Number of training samples")
|
|
|
|
| 89 |
button = gr.Button(label="Update Plot")
|
| 90 |
+
plot = gr.Plot(label="Individual & Voting Predictions")
|
| 91 |
+
|
| 92 |
button.click(fn=app_fn, inputs=[n], outputs=[plot])
|
| 93 |
demo.load(fn=app_fn, inputs=[n], outputs=[plot])
|
| 94 |
|