-
Notifications
You must be signed in to change notification settings - Fork 2
add a json output and a plot collection #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds JSON metrics export and a plots collection feature to the tabular learner tool. The changes enable structured output of model metrics and diagnostic plots for downstream workflows.
Key changes:
- Added JSON metrics export functionality that captures experiment configuration, model details, and evaluation metrics
- Introduced a plots collection output in the Galaxy tool XML for PNG diagnostic plots
- Refactored plot storage mechanism to use a common
_store_plot()method across regression and classification trainers - Added helper functions for JSON serialization of pandas/numpy data structures
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tools/tabularlearner/tabular_learner.xml | Added metrics_json output and plots collection; updated help documentation; added test assertion for metrics_json |
| tools/tabularlearner/base_model_trainer.py | Implemented JSON serialization helpers, _store_plot method, save_metrics_json method, and refactored setup summary preparation |
| tools/tabularlearner/pycaret_regression.py | Updated to use new _store_plot method instead of direct dictionary assignment |
| tools/tabularlearner/pycaret_classification.py | Updated to use new _store_plot method instead of direct dictionary assignment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if v is not None: | ||
| frac = float(v) | ||
| elif total_rows and n_train is not None: | ||
| frac = n_train / total_rows if total_rows else 0 |
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 358 contains redundant logic. The condition if total_rows else 0 is unnecessary because total_rows is already verified to be truthy on line 357. Simplify to frac = n_train / total_rows.
| frac = n_train / total_rows if total_rows else 0 | |
| frac = n_train / total_rows |
| - **Markdown Report**: A concise Markdown summary suitable for embedding in downstream workflows. | ||
|
|
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation mentions a 'Markdown Report' output but no corresponding markdown output is defined in the section. Either remove this documentation or add the markdown output to the tool definition.
| - **Markdown Report**: A concise Markdown summary suitable for embedding in downstream workflows. |
|
|
||
| # 3) Build setup parameters table | ||
| def encode_image_to_base64(self, img_path: str) -> str: | ||
| with open(img_path, "rb") as img_file: |
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File may not be closed if an exception is raised.
No description provided.