Open pradeepdev-1995 opened 1 year ago
Thank you for reaching out to us.
In this context I guess you want to use SageMaker Clarify processing job for bias analysis. Currently the job supports detecting potential bias during data preparation (pre-training) and in trained model (post-training), but it does not support bias mitigation methods yet.
To detect bias for multi-class classification problems: when you configure the Clarify job for bias analysis, there is a parameter called label_values_or_threshold
. If the label is multi-class, the parameter should be a list of label values that are favorable to a demographic group observed in a sample.
E.g., if the label column of your dataset has three classes "A", "B" and "C", and samples that have label value "A" or "B" designates positive result, then assign ["A", "B"]
to the parameter,
If you use the SageMakerClarifyProcessor API in SageMaker Python SDK,
import sagemaker
bias_config = sagemaker.clarify.BiasConfig(
label_values_or_threshold=["A", "B"],
...
)
If you compose the analysis configuration file by yourself, the file should have this entry,
{
...
label_values_or_threshold: ["A", "B"],
...
}
FYI: SageMaker Clarify uses these terms to discuss bias and fairness, and here are the definition of pretraining bias metrics and posttraining bias metrics.
If you have any additional questions regarding the topic, we suggest that you post your queries to the AWS re:Post forum. It is a great platform to get support from the community and our experts. Please remember to include the tag Amazon SageMaker Clarify in your post to help us better understand your query and provide you with the most relevant assistance. We hope this helps and look forward to hearing from you on the forum.
Is Amazon SageMaker Clarify support mitigating bias and improving fairness in multi class classification problems? If so please provide an example for doing the same in a sample multi class classification dataset.