A Python package to assess and improve fairness of machine learning models.
MIT License
Bot releases are hidden (Show)
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
Published by hildeweerts about 1 year ago
fairlearn.metrics.selection_rate
to handle TypeError
when input is scalar.fairlearn.reductions
.sklearn.preprocessing.OneHotEncoder
in fairlearn.adversarial
to ensure compatibility with scikit-learn 1.2.parser
of sklearn.datasets.fetch_openml
in fairlearn.datasets
to liac-arff
to match behavior before scikit-learn 1.2.fairlearn.reductions
by matrix multiplication which can lead to substantial speed-ups for fairlearn.reductions.ExponentiatedGradient
for simple estimators like logistic regression.as_frame
(with default True
) argument to fairlearn.datasets.fetch_diabetes_hospital
.as_frame
default to True
for all remaining datasets.fairlearn.metrics.MetricFrame
so that all results (including aggregations) are computed in the constructor and then cached.fairlearn.adversarial
that changes the loss function NLLLoss
to CrossEntropyLoss
.Published by riedgar-ms almost 2 years ago
X
in _validate_and_reformat_input()
since that is the concern of the underlying estimator and not Fairlearn.MetricFrame
. Methods group_max
,group_min
, difference
and ratio
now accept errors
as a parameter, which could either be raise
or coerce
.grid
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_
.sphinxcontrib-bibtex
extension to manage citations in documentation using bibtex.fairlearn.reductions.ExponentiatedGradient
. Added support for cost sensitive classification in fairlearn.reductions.ErrorRate
.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.fairlearn.metrics.plot_model_comparison
to create scatter plots for comparing multiple models along two metrics.fairlearn.adversarial.AdversarialFairnessClassifier
and fairlearn.adversarial.AdversarialFairnessRegressor
.Published by romanlutz over 3 years ago
count()
metric, so that the number of data points in eachMetricFrame
MetricFrame
constructor API, so metric
argument is now metrics
andpostprocessing.ThresholdOptimizer
now accepts predict_method
as a"predict_proba" and "decision_function"
for"predict"
for hard values from classifiers.fairlearn.widgets
module including the FairlearnDashboard
.fairlearn.metrics.MetricFrame
supports plotting as explainedself
) to fairlearn.reductions.ExponentiatedGradient
.Published by riedgar-ms over 3 years ago
CorrelationRemover
preprocessing technique. This removes correlationscontrol_features
to the classification moments. These allow for datamake_derived_metric()
to use MetricFrame
Published by riedgar-ms almost 4 years ago
ExponentiatedGradient
signature by renaming argument T
tomax_iter
, eta_mul
to eta0
, and by adding run_linprog_step
.eps
withinExponentiatedGradient
. It is now solely responsible for setting the L1constraints
object).eps
as the right-hand side of constraints isConditionalSelectionRate
renamed toUtilityParity
and its subclasses have new arguments on the constructor:
difference_bound
- for difference-based constraints such asratio_bound_slack
- for ratio-based constraints such as demographicratio_bound
argument which represents theratio
.ConditionalLossMoment
and its subclasses have a newupper_bound
with the same purpose for newly enabled regressionExponentiatedGradient
.ErrorRateRatio
renamed to ErrorRateParity
, andTruePositiveRateDifference
renamed to TruePositiveRateParity
since the<metric name>Parity
with the exception ofEqualizedOdds
and DemographicParity
.ConditionalSelectionRate
renamed to UtilityParity
.GroupLossMoment
renamed to BoundedGroupLoss
in order to have aAverageLossMoment
renamed to MeanLoss
.TrueNegativeRateParity
to provide the opposite constraint ofTruePositiveRateParity
to be used with reductions techniques.ThresholdOptimizer
InterpolatedThresholder
to represent the fittedThresholdOptimizer
fairlearn.datasets
module.ExponentiatedGradient
pickle.dump
to sklearn.clone
.sample_weight_name
to GridSearch
andExponentiatedGradient
to control how sample_weight
is supplied toestimator.fit
.MetricFrame
has beenmake_group_summary()
removed (along with relatedPublished by riedgar-ms over 4 years ago
GroupMetricResult
type in favor of a Bunch
.metric_by_group
changed to group_summary
make_group_metric
changed to make_metric_group_summary
{difference,ratio,group_min,group_max}_from_group_summary
.make_derived_metric
.{true,false}_{positive,negative}_rate
<metric>_group_summary
<metric>_{difference,ratio,group_min,group_max}
{demographic_parity,equalized_odds}_{difference,ratio}
fallout_rate
in favor of false_positive_rate
miss_rate
in favor of false_negative_rate
specificity_score
in favor of true_negative_rate
mean_{over,under}prediction
and {balanced_,}root_mean_squared_error
dtype
when creating an emptypandas.Series
.GridSearch
for more than two sensitive features values.fairlearn.reductions
including:
TruePositiveRateDifference
ExponentiatedGradient
require 0-1 labels for classification problems,Published by riedgar-ms over 4 years ago
ThresholdOptimizer
:
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_
ThresholdOptmizer
is now a scikit-learn meta-estimator, and acceptsestimator
parameter. To use a pre-fittedprefit=True
._create_group_metric_set_()
private by prepending with _
.Reduction
base class for reductions methods and replace it withsklearn.base.BaseEstimator
and sklearn.base.MetaEstimatorMixin
.ExponentiatedGradientResult
and GridSearchResult
in favor ofExponentiatedGradient
and GridSearch
objects,X
if it ispandas.DataFrame
.Published by riedgar-ms over 4 years ago
GroupMetricSet
in favour of a create_group_metric_set
methodThresholdOptimizer
to use mixins from scikit-learnPublished by riedgar-ms over 4 years ago
Various updates for GroupMetricResult
and GroupMetricSet
to help with AzureML integration
Published by rihorn2 almost 5 years ago
Published by riedgar-ms almost 5 years ago
Includes the dashboard as well as the core fairlearn
functionality