Update app.py
Browse files
app.py
CHANGED
|
@@ -359,21 +359,25 @@ with gr.Blocks() as demo:
|
|
| 359 |
agent_btn = gr.Button("Run AI Agent (5 Insights + 5 Visualizations)")
|
| 360 |
|
| 361 |
with gr.Row():
|
|
|
|
| 362 |
train_btn = gr.Button("Train Model with Optuna + WandB")
|
|
|
|
|
|
|
| 363 |
metrics_output = gr.JSON(label="Performance Metrics")
|
| 364 |
trials_output = gr.DataFrame(label="Top 7 Hyperparameter Trials")
|
| 365 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
with gr.Row():
|
| 367 |
explain_btn = gr.Button("SHAP + LIME Explainability")
|
| 368 |
shap_img = gr.Image(label="SHAP Summary Plot")
|
| 369 |
lime_img = gr.Image(label="LIME Explanation")
|
| 370 |
-
metrics_output = gr.JSON(label="Evaluation Metrics")
|
| 371 |
-
trials_output = gr.Dataframe(label="Classification Report")
|
| 372 |
-
conf_matrix_img = gr.Image(label="Confusion Matrix")
|
| 373 |
-
metric_plot_img = gr.Image(label="Metric Bar Plot")
|
| 374 |
|
|
|
|
| 375 |
agent_btn.click(fn=analyze_data, inputs=[file_input], outputs=[insights_output, visual_output])
|
| 376 |
train_btn.click(fn=train_model, inputs=[file_input, ab_dropdown], outputs=[metrics_output, trials_output, conf_matrix_img, metric_plot_img])
|
| 377 |
explain_btn.click(fn=explainability, inputs=[], outputs=[shap_img, lime_img])
|
| 378 |
|
| 379 |
-
demo.launch(debug=True)
|
|
|
|
| 359 |
agent_btn = gr.Button("Run AI Agent (5 Insights + 5 Visualizations)")
|
| 360 |
|
| 361 |
with gr.Row():
|
| 362 |
+
ab_dropdown = gr.Dropdown(choices=["A", "B"], label="Choose Model Variant", value="A")
|
| 363 |
train_btn = gr.Button("Train Model with Optuna + WandB")
|
| 364 |
+
|
| 365 |
+
with gr.Row():
|
| 366 |
metrics_output = gr.JSON(label="Performance Metrics")
|
| 367 |
trials_output = gr.DataFrame(label="Top 7 Hyperparameter Trials")
|
| 368 |
|
| 369 |
+
with gr.Row():
|
| 370 |
+
conf_matrix_img = gr.Image(label="Confusion Matrix")
|
| 371 |
+
metric_plot_img = gr.Image(label="Metric Bar Plot")
|
| 372 |
+
|
| 373 |
with gr.Row():
|
| 374 |
explain_btn = gr.Button("SHAP + LIME Explainability")
|
| 375 |
shap_img = gr.Image(label="SHAP Summary Plot")
|
| 376 |
lime_img = gr.Image(label="LIME Explanation")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 377 |
|
| 378 |
+
# Button logic
|
| 379 |
agent_btn.click(fn=analyze_data, inputs=[file_input], outputs=[insights_output, visual_output])
|
| 380 |
train_btn.click(fn=train_model, inputs=[file_input, ab_dropdown], outputs=[metrics_output, trials_output, conf_matrix_img, metric_plot_img])
|
| 381 |
explain_btn.click(fn=explainability, inputs=[], outputs=[shap_img, lime_img])
|
| 382 |
|
| 383 |
+
demo.launch(debug=True)
|