Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,8 +18,8 @@ X, y = diabetes.data, diabetes.target
|
|
| 18 |
def display_table(row_number):
|
| 19 |
X, y = diabetes.data, diabetes.target
|
| 20 |
XX = pd.concat([X, y], axis=1)
|
| 21 |
-
temp_df = XX[row_number : row_number +
|
| 22 |
-
Statement = f"Displaying rows from row {row_number} to {row_number+
|
| 23 |
return Statement, temp_df
|
| 24 |
|
| 25 |
|
|
@@ -193,7 +193,7 @@ with gr.Blocks() as demo:
|
|
| 193 |
"This demo is based on [gradient boosting regression example of scikit-learn](https://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_regression.html) Example.This example demonstrates gradient goosting to produce a predictive model from an ensemble of weak predictive models. Gradient boosting can be used for regression and classification problems. Here, we will train a model to tackle a diabetes regression task."
|
| 194 |
)
|
| 195 |
|
| 196 |
-
with gr.Tab("
|
| 197 |
gr.Markdown("### Below is the diabetes dataset used in this demo π ")
|
| 198 |
gr.Markdown("### You can change the interval of rows to display.")
|
| 199 |
gr.Markdown(
|
|
@@ -201,7 +201,7 @@ with gr.Blocks() as demo:
|
|
| 201 |
)
|
| 202 |
total_rows = X.shape[0]
|
| 203 |
rows_number = gr.Slider(
|
| 204 |
-
0, total_rows, label="Displaying Rows", value=
|
| 205 |
)
|
| 206 |
|
| 207 |
rows_number.change(
|
|
@@ -210,7 +210,6 @@ with gr.Blocks() as demo:
|
|
| 210 |
outputs=[gr.Text(label="Row"), gr.DataFrame()],
|
| 211 |
)
|
| 212 |
|
| 213 |
-
with gr.Tab("Train the model"):
|
| 214 |
gr.Markdown(
|
| 215 |
"# Play with the parameters to see how the model performance changes"
|
| 216 |
)
|
|
|
|
| 18 |
def display_table(row_number):
|
| 19 |
X, y = diabetes.data, diabetes.target
|
| 20 |
XX = pd.concat([X, y], axis=1)
|
| 21 |
+
temp_df = XX[row_number : row_number + 5]
|
| 22 |
+
Statement = f"Displaying rows from row {row_number} to {row_number+5}"
|
| 23 |
return Statement, temp_df
|
| 24 |
|
| 25 |
|
|
|
|
| 193 |
"This demo is based on [gradient boosting regression example of scikit-learn](https://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_regression.html) Example.This example demonstrates gradient goosting to produce a predictive model from an ensemble of weak predictive models. Gradient boosting can be used for regression and classification problems. Here, we will train a model to tackle a diabetes regression task."
|
| 194 |
)
|
| 195 |
|
| 196 |
+
with gr.Tab("Train the model"):
|
| 197 |
gr.Markdown("### Below is the diabetes dataset used in this demo π ")
|
| 198 |
gr.Markdown("### You can change the interval of rows to display.")
|
| 199 |
gr.Markdown(
|
|
|
|
| 201 |
)
|
| 202 |
total_rows = X.shape[0]
|
| 203 |
rows_number = gr.Slider(
|
| 204 |
+
0, total_rows, label="Displaying Rows", value=5, step=5
|
| 205 |
)
|
| 206 |
|
| 207 |
rows_number.change(
|
|
|
|
| 210 |
outputs=[gr.Text(label="Row"), gr.DataFrame()],
|
| 211 |
)
|
| 212 |
|
|
|
|
| 213 |
gr.Markdown(
|
| 214 |
"# Play with the parameters to see how the model performance changes"
|
| 215 |
)
|