ENH: Add OptimizedPreprocessing algorithm from Calmon et al. (fixes #9) - #12
Open
divyanshbhai wants to merge 4 commits into
Open
ENH: Add OptimizedPreprocessing algorithm from Calmon et al. (fixes #9)#12divyanshbhai wants to merge 4 commits into
divyanshbhai wants to merge 4 commits into
Conversation
added 4 commits
October 15, 2025 19:11
- Create _optimized_preprocessing.py with class skeleton - Add OptimizedPreprocessing to preprocessing module exports - Implement basic fit/transform interface following sklearn conventions - Add comprehensive docstring with algorithm description and references Part of implementing Calmon et al. algorithm for issue usarfoss#9
- Add probabilistic transformation learning via constrained optimization - Implement feature discretization for tractable optimization - Add demographic parity constraints with epsilon tolerance - Implement distortion minimization objective function - Add probabilistic data transformation with noise injection Follows Calmon et al. methodology for discrimination prevention
- Create test_optimized_preprocessing.py with 15+ test cases - Test initialization, fit/transform functionality, and edge cases - Add parameter validation and input validation - Test reproducibility, different epsilon values, and sklearn compatibility - Verify error handling for invalid inputs and parameters Ensures robust implementation following fairlearn testing standards
- Add detailed section in preprocessing.rst user guide - Include mathematical formulation and algorithm description - Add practical usage example with synthetic data - Include Calmon et al. reference in bibliography - Document fairness-utility trade-off via epsilon parameter Completes documentation requirements for issue usarfoss#9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the preprocessing algorithm from "Optimized Pre-Processing for Discrimination Prevention" by Calmon et al. as requested in issue #9.
Changes
OptimizedPreprocessingclass infairlearn.preprocessingtest.unit.preprocessing.test_optimized_preprocessingImplementation Details
TransformerMixininterface withfit/transformmethodsTesting
Documentation
Fix #9