Skip to content

Conversation

@qchiujunhao
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 30, 2025 14:20
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Oct 30, 2025

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.

Suggested change
frac = n_train / total_rows if total_rows else 0
frac = n_train / total_rows

Copilot uses AI. Check for mistakes.
Comment on lines +301 to +302
- **Markdown Report**: A concise Markdown summary suitable for embedding in downstream workflows.

Copy link

Copilot AI Oct 30, 2025

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.

Suggested change
- **Markdown Report**: A concise Markdown summary suitable for embedding in downstream workflows.

Copilot uses AI. Check for mistakes.

# 3) Build setup parameters table
def encode_image_to_base64(self, img_path: str) -> str:
with open(img_path, "rb") as img_file:
Copy link

Copilot AI Oct 30, 2025

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.

Copilot uses AI. Check for mistakes.
@qchiujunhao qchiujunhao marked this pull request as draft October 31, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants