Skip to content
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

UPDATE: MAPIEv1 Backend - Split .fit into .fit_single_estimator and fit_multi_estimator #545

Merged
merged 19 commits into from
Dec 2, 2024

Conversation

jawadhussein462
Copy link
Collaborator

@jawadhussein462 jawadhussein462 commented Nov 27, 2024

…_multi_estimators

Description

This PR refactors the MAPIE ibrary by splitting the .fit method in EnsembleRegressor into two distinct methods: .fit_single_estimator and .fit_multi_estimators. The goal is to enhance modularity, readability, and maintainability of the codebase.

This refactoring is part of an ongoing effort to align the MAPIE library with modern software engineering practices. It ensures better scalability, maintainability, and adaptability for future features or modifications. The changes also address the growing need to handle single and multi-estimator workflows distinctly in the library.

  1. Refactoring .fit Logic:

    • The .fit method is now divided into:
      • .fit_single_estimator: Handles the fitting logic for a single estimator.
      • .fit_multi_estimators: Handles the fitting logic for multiple estimators in an ensemble.
  2. Reorganization of v0 and v1 Components:

    • **v0 **:
      • v0.conformlize:
        Combines logic for fit_multi_estimators and calibration-based prediction (predict_calib).
      • v0.fit:
        Combines fit_single_estimator and conformlize to handle the full fitting process.
    • v1:
      • v1.fit:
        Only includes fit_single_estimator, streamlining the single-estimator fitting process.
      • v1.conformlize:
        Retains the structure of v0.conformlize, combining multi-estimator fitting and prediction calibration.

Type of change

  • New feature Non-breaking change which adds functionality

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
  • Documentation builds successfully and without warnings : make doc

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (v1@e3c76b2). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             v1      #545   +/-   ##
======================================
  Coverage      ?   100.00%           
======================================
  Files         ?        62           
  Lines         ?      6001           
  Branches      ?       990           
======================================
  Hits          ?      6001           
  Misses        ?         0           
  Partials      ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@Valentin-Laurent Valentin-Laurent left a comment

Choose a reason for hiding this comment

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

Good job 💪🏻
Few comments

mapie/estimator/regressor.py Outdated Show resolved Hide resolved
mapie/estimator/regressor.py Outdated Show resolved Hide resolved
mapie/estimator/regressor.py Outdated Show resolved Hide resolved
mapie/regression/regression.py Outdated Show resolved Hide resolved
mapie/regression/regression.py Outdated Show resolved Hide resolved
mapie_v1/regression.py Outdated Show resolved Hide resolved
@Valentin-Laurent Valentin-Laurent merged commit 52b4045 into v1 Dec 2, 2024
8 checks passed
@Valentin-Laurent Valentin-Laurent deleted the v1-devide-fit branch December 2, 2024 13:52
Valentin-Laurent pushed a commit that referenced this pull request Dec 2, 2024
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Dec 9, 2024
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Dec 17, 2024
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
jawadhussein462 added a commit that referenced this pull request Dec 20, 2024
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
jawadhussein462 added a commit that referenced this pull request Dec 20, 2024
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Dec 29, 2024
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Jan 5, 2025
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Jan 7, 2025
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Jan 7, 2025
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Jan 8, 2025
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Jan 9, 2025
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
Valentin-Laurent pushed a commit that referenced this pull request Jan 10, 2025
…stimator in MapieRegressor and EnsembleRegressor, implement (wip) CrossConformalRegressor (#545)
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.

3 participants