-
Notifications
You must be signed in to change notification settings - Fork 457
Introspection test changes #395
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 removes introspection test code and adds new test functions for validating fit mode consistency. The changes focus on cleaning up complex preprocessing inspection tests while adding simpler consistency checks.
- Removes introspection tests that used mocking to capture internal model tensors
- Adds new tests to verify that different fit modes produce equivalent results
- Removes unused imports related to unittest and mocking
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/test_regressor_interface.py | Adds test for regressor fit mode result consistency |
tests/test_finetuning_regressor.py | Removes complex preprocessing inspection test class and related imports |
tests/test_finetuning_classifier.py | Removes complex preprocessing inspection test class and related imports |
tests/test_classifier_interface.py | Adds test for classifier fit mode result consistency |
Comments suppressed due to low confidence (2)
tests/test_regressor_interface.py:150
- The TODO comment indicates potential accuracy issues with the 'low_memory' fit mode that are not being properly tested. This should be investigated and either fixed or documented with a proper explanation of why the reduced precision is expected.
# TODO: It's only equal to one decimal place. Verify if actually broken.
tests/test_regressor_interface.py:151
- Using only 1 decimal place precision (decimal=1) for the low_memory mode comparison is much less strict than the 5 decimal places used for other modes. This significant difference in expected precision should be documented or investigated.
np.testing.assert_array_almost_equal(preds, tabpfn.predict(X), decimal=1)
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.
Summary of Changes
Hello @noahho, 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 enhances the robustness of the test suite by adding new tests that specifically validate the consistency of predictions from TabPFNClassifier
and TabPFNRegressor
across their various fit_mode
configurations. Concurrently, it streamlines the test base by removing overly granular and potentially fragile internal preprocessing inspection tests, shifting the focus to end-user observable correctness.
Highlights
- Classifier
fit_mode
Consistency Tests: I've added a new test,test_fit_modes_all_return_equal_results
, totests/test_classifier_interface.py
. This test verifies that theTabPFNClassifier
produces consistent prediction probabilities and class predictions across differentfit_mode
options, specificallyfit_preprocessors
,fit_with_cache
, andlow_memory
, ensuring functional equivalence regardless of the chosen fitting strategy. - Regressor
fit_mode
Consistency Tests: Similarly, a new testtest_fit_modes_all_return_equal_results
has been introduced intests/test_regressor_interface.py
. This test confirms that theTabPFNRegressor
yields consistent regression predictions when using variousfit_mode
options, includingfit_preprocessors
,fit_with_cache
, andlow_memory
. - Test Suite Refinement: I've removed complex and potentially brittle internal preprocessing consistency tests (
TestTabPFNClassifierPreprocessingInspection
andTestTabPFNPreprocessingInspection
) fromtests/test_finetuning_classifier.py
andtests/test_finetuning_regressor.py
. These tests aimed to compare internal tensors, which can be prone to floating-point issues and are less focused on the observable output behavior of the models.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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 is currently in preview and 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 to provide feedback.
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
-
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. ↩
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.
Code Review
This pull request refactors the introspection tests by replacing complex internal tensor consistency checks with simpler interface tests verifying prediction consistency across different fit_mode
settings. I've provided feedback to refactor the new tests to improve maintainability and highlighted a potential correctness issue in the regressor test that needs investigation.
Motivation and Context
Public API Changes
How Has This Been Tested?
Checklist
CHANGELOG.md
(if relevant for users).