Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -168,7 +168,8 @@ def train_model(x, target_cols):
|
|
168 |
time.sleep(6)
|
169 |
performance_plot = cv2.imread("model_performance.png")
|
170 |
metrics = pd.DataFrame([[0.05, 0.017]], columns=["RMSE", "MAPE"])
|
171 |
-
|
|
|
172 |
|
173 |
|
174 |
|
@@ -228,6 +229,7 @@ with gr.Blocks(css=css_styling, title=page_title, theme=osium_theme) as demo:
|
|
228 |
output_text = gr.Textbox(label="Training results")
|
229 |
output_plot = gr.Image(label="Training performance", elem_classes="output-image")
|
230 |
output_performance = gr.DataFrame(label="Model performance")
|
|
|
231 |
|
232 |
with gr.Tab(label="Run your model"):
|
233 |
with gr.Row():
|
@@ -391,7 +393,7 @@ with gr.Blocks(css=css_styling, title=page_title, theme=osium_theme) as demo:
|
|
391 |
train_button.click(
|
392 |
fn=train_model,
|
393 |
inputs=[input_csv, target_columns],
|
394 |
-
outputs=[output_text, output_plot, output_performance],
|
395 |
show_progress=True,
|
396 |
)
|
397 |
|
|
|
168 |
time.sleep(6)
|
169 |
performance_plot = cv2.imread("model_performance.png")
|
170 |
metrics = pd.DataFrame([[0.05, 0.017]], columns=["RMSE", "MAPE"])
|
171 |
+
next_df = x.sample(n=5, random_state=12)
|
172 |
+
return "Model successfully adapted to your data!", performance_plot, metrics, next_df
|
173 |
|
174 |
|
175 |
|
|
|
229 |
output_text = gr.Textbox(label="Training results")
|
230 |
output_plot = gr.Image(label="Training performance", elem_classes="output-image")
|
231 |
output_performance = gr.DataFrame(label="Model performance")
|
232 |
+
output_next_experiments = gr.DataFrame(label="Suggested experiments to improve performance")
|
233 |
|
234 |
with gr.Tab(label="Run your model"):
|
235 |
with gr.Row():
|
|
|
393 |
train_button.click(
|
394 |
fn=train_model,
|
395 |
inputs=[input_csv, target_columns],
|
396 |
+
outputs=[output_text, output_plot, output_performance, output_next_experiments],
|
397 |
show_progress=True,
|
398 |
)
|
399 |
|