Releases: fairlearn/fairlearn
Releases · fairlearn/fairlearn
v0.10.0
-
Added bootstrapping to :class:
MetricFrame
, along with a new section in the user guide -
Added intersectionality in mental health care example notebook.
-
Added user guide for :class:
fairlearn.postprocessing.ThresholdOptimizer
v0.9.0
- Added Credit Loan Decisions example notebook.
- Bugfix for
fairlearn.metrics.selection_rate
to handleTypeError
when input is scalar. - Added support for pickling classes in
fairlearn.reductions
. - Bugfix for
sklearn.preprocessing.OneHotEncoder
infairlearn.adversarial
to ensure compatibility with scikit-learn 1.2. - Set default value of
parser
ofsklearn.datasets.fetch_openml
infairlearn.datasets
toliac-arff
to match behavior before scikit-learn 1.2. - Replace calculations in
fairlearn.reductions
by matrix multiplication which can lead to substantial speed-ups forfairlearn.reductions.ExponentiatedGradient
for simple estimators like logistic regression. - Added
as_frame
(with defaultTrue
) argument tofairlearn.datasets.fetch_diabetes_hospital
. - Changed
as_frame
default toTrue
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 functionNLLLoss
toCrossEntropyLoss
. - 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
- 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
. Methodsgroup_max
,group_min
,difference
andratio
now accepterrors
as a parameter, which could either beraise
orcoerce
. - Fixed a bug whereby passing a custom
grid
object to aGridSearch
reduction would result in aKeyError
if the column names were not ordered integers. fairlearn.preprocessing.CorrelationRemover
now exposesn_features_in_
andfeature_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 infairlearn.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
andfairlearn.adversarial.AdversarialFairnessRegressor
.
v0.7.0
- Added new
count()
metric, so that the number of data points in each
group is noted when usingMetricFrame
- Changed
MetricFrame
constructor API, sometric
argument is nowmetrics
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 acceptspredict_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 theFairlearnDashboard
.
Instead, thefairlearn.metrics.MetricFrame
supports plotting as explained
in the corresponding user guide section. - Added return value (
self
) tofairlearn.reductions.ExponentiatedGradient
.
v0.6.2
v0.6.1
v0.6.0
- 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 useMetricFrame
- Assorted small documentation fixes
v0.5.0
- Adjust classes to abide by naming conventions for attributes.
- Change
ExponentiatedGradient
signature by renaming argumentT
to
max_iter
,eta_mul
toeta0
, and by addingrun_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 theconstraints
object).
The other usage ofeps
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 differenceratio_bound_slack
- for ratio-based constraints such as demographic
parity ratio- Additionally, there's a
ratio_bound
argument which represents the
argument previously calledratio
.
- Regression moments:
ConditionalLossMoment
and its subclasses have a new
argumentupper_bound
with the same purpose for newly enabled regression
scenarios onExponentiatedGradient
.
For a comprehensive overview of available constraints refer to the new user
guide on fairness constraints for reductions methods.
- Classification moments:
- Renamed several constraints to create a uniform naming convention according
to the accepted metric harmonization proposal:ErrorRateRatio
renamed toErrorRateParity
, and
TruePositiveRateDifference
renamed toTruePositiveRateParity
since the
desired pattern is<metric name>Parity
with the exception of
EqualizedOdds
andDemographicParity
.ConditionalSelectionRate
renamed toUtilityParity
.GroupLossMoment
renamed toBoundedGroupLoss
in order to have a
descriptive name and for consistency with the paper. Similarly,
AverageLossMoment
renamed toMeanLoss
.
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
frompickle.dump
tosklearn.clone
. - Add an argument
sample_weight_name
toGridSearch
and
ExponentiatedGradient
to control howsample_weight
is supplied to
estimator.fit
. - Large changes to the metrics API. A new class
MetricFrame
has been
introduced, andmake_group_summary()
removed (along with related
functions). Please see the documentation and examples for more information.
Release v0.4.6
- Handle case where reductions relabeling results in a single class
- Refactor metrics:
- Remove
GroupMetricResult
type in favor of aBunch
. - Rename and slightly update signatures:
metric_by_group
changed togroup_summary
make_group_metric
changed tomake_metric_group_summary
- Add group summary transformers
{difference,ratio,group_min,group_max}_from_group_summary
. - Add factory
make_derived_metric
.
- Remove
- 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}
- base metrics
- Remove metrics:
fallout_rate
in favor offalse_positive_rate
miss_rate
in favor offalse_negative_rate
specificity_score
in favor oftrue_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.
Release v0.4.5
- Changes to
ThresholdOptimizer
:- Separate plotting for
ThresholdOptimizer
into its own plotting function. ThresholdOptimizer
now performs validations duringfit
, and not during
__init__
. It also stores the fitted given estimator in theestimator_
attribute.ThresholdOptmizer
is now a scikit-learn meta-estimator, and accepts
an estimator through theestimator
parameter. To use a pre-fitted
estimator, passprefit=True
.
- Separate plotting for
- 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
andsklearn.base.MetaEstimatorMixin
. - Remove
ExponentiatedGradientResult
andGridSearchResult
in favor of
storing the values and objects resulting from fitting the meta-estimator
directly in theExponentiatedGradient
andGridSearch
objects,
respectively. - Fix regression in input validation that dropped metadata from
X
if it is
provided as apandas.DataFrame
.