Skip to content

Conversation

@VishnoiAman777
Copy link

@VishnoiAman777 VishnoiAman777 commented Oct 30, 2025

Description

This change adds a test case to ensure that predict_params are correctly passed and handled when using Ensemble Classifier to predict_proba function for an estimator and RAPSConformityScore Class. Addtional test test_raps_with_predict_params is added to verify that the predict_params are properly passed through the fit and predict methods in RAPSConformityScore.

Fixes #614

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

The following test was added to verify the changes:

  • test_raps_with_predict_params
    • This test verifies that predict_params are correctly passed through the fit and predict methods when using RAPSConformityScore

Checklist

  • I have read the contributing guidelines
  • I have updated the HISTORY.rst and AUTHORS.rst files
  • Linting passes successfully: make lint
  • Typing passes successfully: make type-check
  • Unit tests pass successfully: make tests
  • Coverage is 100%: make coverage
  • When updating documentation: doc builds successfully and without warnings: make doc
  • When updating documentation: code examples in doc run successfully: make doctest

@allglc
Copy link
Collaborator

allglc commented Oct 30, 2025

Hello @VishnoiAman777, thank you for the contribution!

It seems that indeed predict_params were not passed to the estimator in predict_proba_calib for the "prefit" case. Good catch!

predict_params were also not passed to the estimator in RAPSConformityScore. Do you think it is the only score where the issue happens? I think it is but I would like your opinion.

I have made comments on some of your modifications, please look at them when you have the time.

Otherwise, I was wondering about the possible uses of predict_params. Is it only used by gradient boosting models? Are you aware of another use?

@VishnoiAman777
Copy link
Author

Hi @allglc,
Thank you for your response.

The RAPSConformityScore is the only case where we require predict_params. This is because of k_star and lambda required in RAPS. As far as I can tell from reviewing the codebase, this requirement does not apply elsewhere.

As you have said predict_params is typically needed in Boosting implementations, many third-party libraries—such as XGBoost and CatBoost—also support them. My rationale for including them is to ensure compatibility with any estimator that follows the scikit-learn convention. This also allows for their use in custom estimators and within scikit-learn pipeline objects.

Additionally, I am not able to see any comments on my changes yet as you have mentioned. Have you started a code review?

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.

predict_params is not passed everywhere in MapieClassifier in some settings

2 participants