You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the fairlearn bias mitigation methods with multi-dimension data like images. To my understanding, the postprocessing methods like ThresholdOptimizer, should not be constraint by the type of classifiers. However, when I try to implement the ThresholdOptimizer with input X (shape:[BS, C, W, H]), it keeps giving me error like:
ValueError: Found array with dim 4. None expected <= 2.
Which, if I understand correctly, suggests that X should only have a dim <=2.
I try to wrapped the clf model based on sklearn estimator, but it does not help as well.
I was wondering, how could I solve this issue?
version
scikit-learn 1.3.0
The error is coming from this line if not allow_nd and array.ndim >= 3: raise ValueError( "Found array with dim %d. %s expected <= 2." % (array.ndim, estimator_name) )
in sklearn/utils/validation.py:953.
I belive that in fairlearn/utils/_input_validation.py:89: X, y = check_X_y(X, y, dtype=None, force_all_finite=False), we should add allow_nd = True.
The text was updated successfully, but these errors were encountered:
Hi @nina-weng! More information would help us troubleshoot. Can you please post a screenshot of the code you are working with here, including the parts with the unmitigated estimator and the issue with Threshold Optimizer?
I am trying to use the fairlearn bias mitigation methods with multi-dimension data like images. To my understanding, the postprocessing methods like ThresholdOptimizer, should not be constraint by the type of classifiers. However, when I try to implement the ThresholdOptimizer with input X (shape:[BS, C, W, H]), it keeps giving me error like:
Which, if I understand correctly, suggests that X should only have a dim <=2.
I try to wrapped the clf model based on sklearn estimator, but it does not help as well.
I was wondering, how could I solve this issue?
version
scikit-learn 1.3.0
The error is coming from this line
if not allow_nd and array.ndim >= 3: raise ValueError( "Found array with dim %d. %s expected <= 2." % (array.ndim, estimator_name) )
in sklearn/utils/validation.py:953.
I belive that in fairlearn/utils/_input_validation.py:89:
X, y = check_X_y(X, y, dtype=None, force_all_finite=False)
, we should addallow_nd = True
.The text was updated successfully, but these errors were encountered: