Skip to content

Conversation

noahho
Copy link
Collaborator

@noahho noahho commented Jul 17, 2025

Motivation and Context


Public API Changes

  • No Public API changes
  • Yes, Public API changes (Details below)

How Has This Been Tested?


Checklist

  • The changes have been tested locally.
  • Documentation has been updated (if the public API or usage changes).
  • A entry has been added to CHANGELOG.md (if relevant for users).
  • The code follows the project's style guidelines.
  • I have considered the impact of these changes on the public API.

@Copilot Copilot AI review requested due to automatic review settings July 17, 2025 14:18
Copy link
Contributor

@Copilot 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 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)

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.

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, to tests/test_classifier_interface.py. This test verifies that the TabPFNClassifier produces consistent prediction probabilities and class predictions across different fit_mode options, specifically fit_preprocessors, fit_with_cache, and low_memory, ensuring functional equivalence regardless of the chosen fitting strategy.
  • Regressor fit_mode Consistency Tests: Similarly, a new test test_fit_modes_all_return_equal_results has been introduced in tests/test_regressor_interface.py. This test confirms that the TabPFNRegressor yields consistent regression predictions when using various fit_mode options, including fit_preprocessors, fit_with_cache, and low_memory.
  • Test Suite Refinement: I've removed complex and potentially brittle internal preprocessing consistency tests (TestTabPFNClassifierPreprocessingInspection and TestTabPFNPreprocessingInspection) from tests/test_finetuning_classifier.py and tests/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

  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 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.

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.

1 participant