Skip to content

Make the filter_outlier method public#382

Merged
L-M-Sherlock merged 1 commit intoopen-spaced-repetition:mainfrom
ishiko732:export-filter_outlier
Dec 15, 2025
Merged

Make the filter_outlier method public#382
L-M-Sherlock merged 1 commit intoopen-spaced-repetition:mainfrom
ishiko732:export-filter_outlier

Conversation

@ishiko732
Copy link
Member

The tests for evaluate and evaluate_with_time_series_splits require filter_outlier to be applied to the training set, but this method is currently internal and not publicly accessible.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ishiko732, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request exposes the filter_outlier utility function, which was previously restricted to internal crate usage. The primary motivation for this change is to facilitate comprehensive testing of evaluation methods that require this function for data preprocessing, ensuring that the necessary data manipulation logic is available for test environments.

Highlights

  • Visibility Change: The filter_outlier function has been changed from pub(crate) to pub, making it publicly accessible outside of its containing crate.
  • Test Enablement: This change is necessary to allow tests for evaluate and evaluate_with_time_series_splits to properly apply filter_outlier to training sets, as it was previously an internal method.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly makes the filter_outlier function public, which is necessary for its use in tests as described. The changes in src/dataset.rs and src/lib.rs are appropriate for this purpose.

While reviewing, I noticed a potential bug in the prepare_training_data function within src/dataset.rs (line 264), which is outside the scope of this PR's changes. It appears to pass the entire items vector to filter_outlier instead of the trainset derived from partitioning. This could lead to incorrect outlier filtering. This is what it looks like:

(dataset_for_initialization, trainset) = filter_outlier(dataset_for_initialization, items);

It should probably be:

(dataset_for_initialization, trainset) = filter_outlier(dataset_for_initialization, trainset);

This is demonstrated by the correct usage in test_filter_outlier. This could be addressed in a follow-up pull request.

Overall, the changes in this PR are approved.

Copy link
Member

@L-M-Sherlock L-M-Sherlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@L-M-Sherlock L-M-Sherlock merged commit b46226a into open-spaced-repetition:main Dec 15, 2025
4 checks passed
@ishiko732 ishiko732 deleted the export-filter_outlier branch December 15, 2025 08:07
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