Fairlearn Versions Save

A Python package to assess and improve fairness of machine learning models.

v0.10.0

5 months ago

v0.9.0

9 months ago
  • Added Credit Loan Decisions example notebook.
  • Bugfix for fairlearn.metrics.selection_rate to handle TypeError when input is scalar.
  • Added support for pickling classes in fairlearn.reductions.
  • Bugfix for sklearn.preprocessing.OneHotEncoder in fairlearn.adversarial to ensure compatibility with scikit-learn 1.2.
  • Set default value of parser of sklearn.datasets.fetch_openml in fairlearn.datasets to liac-arff to match behavior before scikit-learn 1.2.
  • Replace calculations in fairlearn.reductions by matrix multiplication which can lead to substantial speed-ups for fairlearn.reductions.ExponentiatedGradient for simple estimators like logistic regression.
  • Added as_frame (with default True) argument to fairlearn.datasets.fetch_diabetes_hospital.
  • Changed as_frame default to True for all remaining datasets.
  • Changed fairlearn.metrics.MetricFrame so that all results (including aggregations) are computed in the constructor and then cached.
  • Bugfix for fairlearn.adversarial that changes the loss function NLLLoss to CrossEntropyLoss.
  • Various documentation tweaks and enhancements, including restructuring of the user guide and breaking out information in the API reference to separate pages.

v0.8.0

1 year ago
  • Relaxed checks made on X in _validate_and_reformat_input() since that is the concern of the underlying estimator and not Fairlearn.
  • Add support for Python 3.9 and 3.10, remove support for Python 3.6 and 3.7
  • Added error handling in MetricFrame. Methods group_max,group_min, difference and ratio now accept errors as a parameter, which could either be raise or coerce.
  • Fixed a bug whereby passing a customgrid object to aGridSearch reduction would result in a KeyError if the column names were not ordered integers.
  • fairlearn.preprocessing.CorrelationRemover now exposes n_features_in_ and feature_names_in_.
  • Added the ACSIncome dataset and corresponding documentation.
  • Add sphinxcontrib-bibtex extension to manage citations in documentation using bibtex.
  • Added support for explicitly specifying optimization objective in fairlearn.reductions.ExponentiatedGradient. Added support for cost sensitive classification in fairlearn.reductions.ErrorRate.
  • Internal performance improvements for fairlearn.metrics.MetricFrame. Some results may now have a more appropriate type thanobject, but otherwise the only visible difference should be a substantial speed increase.
  • Added fairlearn.metrics.plot_model_comparison to create scatter plots for comparing multiple models along two metrics.
  • Added adversarial mitigation approaches fairlearn.adversarial.AdversarialFairnessClassifier and fairlearn.adversarial.AdversarialFairnessRegressor.

v0.7.0

2 years ago
  • Added new count() metric, so that the number of data points in each group is noted when using MetricFrame
  • Changed MetricFrame constructor API, so metric argument is now metrics and all positional arguments are now keyword arguments. Previous call format still works (until v0.10.0), but issues a deprecation warning.
  • postprocessing.ThresholdOptimizer now accepts predict_method as a parameter which allows users to define which estimator method should be used to get the prediction values: "predict_proba" and "decision_function" for soft values and "predict" for hard values from classifiers.
  • Removed fairlearn.widgets module including the FairlearnDashboard. Instead, the fairlearn.metrics.MetricFrame supports plotting as explained in the corresponding user guide section.
  • Added return value (self) to fairlearn.reductions.ExponentiatedGradient.

v0.6.2

3 years ago
  • Bugfix for _merge_columns() when using multiple sensitive features with long names. This previously caused groups to get merged if the concatenation of their string representations was identical until the cutoff limit.

v0.6.1

3 years ago
  • Bugfix for _create_group_metric_set(). Fixes the list of metrics computed for regression and adds a set of metrics for 'probability' problems PR
  • Updated 'Credit Card' notebook PR
  • Added some overlooked MetricFrame tests PR
  • Various documentation tweaks and enhancements

v0.6.0

3 years ago
  • Add CorrelationRemover preprocessing technique. This removes correlations between sensitive and non-sensitive features while retaining as much information as possible
  • Add control_features to the classification moments. These allow for data stratification, with fairness constraints enforced within each stratum, but not between strata
  • Update make_derived_metric() to use MetricFrame
  • Assorted small documentation fixes

v0.5.0

3 years ago
  • Adjust classes to abide by naming conventions for attributes.
  • Change ExponentiatedGradient signature by renaming argument T to max_iter, eta_mul to eta0, and by adding run_linprog_step.
  • API refactoring to separate out different uses of eps within ExponentiatedGradient. It is now solely responsible for setting the L1 norm bound in the optimization (which controls the excess constraint violation beyond what is allowed by the constraints object). The other usage of eps as the right-hand side of constraints is now captured directly in the moment classes as follows:
    • Classification moments: ConditionalSelectionRate renamed to UtilityParity and its subclasses have new arguments on the constructor:
      • difference_bound - for difference-based constraints such as demographic parity difference
      • ratio_bound_slack - for ratio-based constraints such as demographic parity ratio
      • Additionally, there's a ratio_bound argument which represents the argument previously called ratio.
    • Regression moments: ConditionalLossMoment and its subclasses have a new argument upper_bound with the same purpose for newly enabled regression scenarios on ExponentiatedGradient. For a comprehensive overview of available constraints refer to the new user guide on fairness constraints for reductions methods.
  • Renamed several constraints to create a uniform naming convention according to the accepted metric harmonization proposal:
    • ErrorRateRatio renamed to ErrorRateParity, and TruePositiveRateDifference renamed to TruePositiveRateParity since the desired pattern is <metric name>Parity with the exception of EqualizedOdds and DemographicParity.
    • ConditionalSelectionRate renamed to UtilityParity.
    • GroupLossMoment renamed to BoundedGroupLoss in order to have a descriptive name and for consistency with the paper. Similarly, AverageLossMoment renamed to MeanLoss. For a comprehensive overview of available constraints refer to the new user guide on fairness constraints for reductions methods.
  • Added TrueNegativeRateParity to provide the opposite constraint of TruePositiveRateParity to be used with reductions techniques.
  • Add new constraints and objectives in ThresholdOptimizer
  • Add class InterpolatedThresholder to represent the fitted ThresholdOptimizer
  • Add fairlearn.datasets module.
  • Change the method to make copies of the estimator in ExponentiatedGradient from pickle.dump to sklearn.clone.
  • Add an argument sample_weight_name to GridSearch and ExponentiatedGradient to control how sample_weight is supplied to estimator.fit.
  • Large changes to the metrics API. A new class MetricFrame has been introduced, and make_group_summary() removed (along with related functions). Please see the documentation and examples for more information.

v0.4.6

4 years ago
  • Handle case where reductions relabeling results in a single class
  • Refactor metrics:
    • Remove GroupMetricResult type in favor of a Bunch.
    • Rename and slightly update signatures:
      • metric_by_group changed to group_summary
      • make_group_metric changed to make_metric_group_summary
    • Add group summary transformers {difference,ratio,group_min,group_max}_from_group_summary.
    • Add factory make_derived_metric.
  • Add new metrics:
    • base metrics {true,false}_{positive,negative}_rate
    • group summary metrics <metric>_group_summary
    • derived metrics <metric>_{difference,ratio,group_min,group_max}
    • disparity metrics {demographic_parity,equalized_odds}_{difference,ratio}
  • Remove metrics:
    • fallout_rate in favor of false_positive_rate
    • miss_rate in favor of false_negative_rate
    • specificity_score in favor of true_negative_rate
  • Change from public to private:
    • mean_{over,under}prediction and {balanced_,}root_mean_squared_error changed to the versions with a leading underscore
  • Fix warning due to changing default dtype when creating an empty pandas.Series.
  • Enable GridSearch for more than two sensitive features values.
  • Add new disparity constraints for reductions methods as moments in fairlearn.reductions including:
    • TruePositiveRateDifference
    • ratio options for all existing constraints in addition to the default, i.e., difference between groups w.r.t. the relevant metric.
  • Make ExponentiatedGradient require 0-1 labels for classification problems, pending a better solution for Issue 339.

v0.4.5

4 years ago
  • Changes to ThresholdOptimizer:
    • Separate plotting for ThresholdOptimizer into its own plotting function.
    • ThresholdOptimizer now performs validations during fit, and not during __init__. It also stores the fitted given estimator in the estimator_ attribute.
    • ThresholdOptmizer is now a scikit-learn meta-estimator, and accepts an estimator through the estimator parameter. To use a pre-fitted estimator, pass prefit=True.
  • Made _create_group_metric_set_() private by prepending with _. Also changed the arguments, so that this routine requires dictionaries for the predictions and sensitive features. This is a breaking change.
  • Remove Reduction base class for reductions methods and replace it with sklearn.base.BaseEstimator and sklearn.base.MetaEstimatorMixin.
  • Remove ExponentiatedGradientResult and GridSearchResult in favor of storing the values and objects resulting from fitting the meta-estimator directly in the ExponentiatedGradient and GridSearch objects, respectively.
  • Fix regression in input validation that dropped metadata from X if it is provided as a pandas.DataFrame.