fairlearn: Bug: class labels not preserved
>>> eg = ExponentiatedGradient(constraints=DemographicParity(), estimator=LogisticRegression())
>>> eg.fit(pd.DataFrame([[1], [2], [3]]), [2, 0, 0], sensitive_features=[3,2,4])
>>> eg.predict([[1], [2], [3]])
0 0
1 0
2 1
dtype: int32
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (16 by maintainers)
I’ve been wanting to mention that there’s an issue with handling the outputs in the current codebase. As examples, here’s how we handle the output in the
GradientBoostingClsasifier
:https://github.com/scikit-learn/scikit-learn/blob/dcfb3df9a3df5aa2a608248316d537cd6b3643ee/sklearn/ensemble/_gb.py#L1095-L1105
(for some reason github’s not rendering them right, so here’s the code)
and in
HistGradientBoostingClassifier
:https://github.com/scikit-learn/scikit-learn/blob/dcfb3df9a3df5aa2a608248316d537cd6b3643ee/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py#L1129-L1142
(for some reason github’s not rendering them right, so here’s the code)
I prefer the second solution (which is a much more recent code).