interpretml / DiCE

Generate Diverse Counterfactual Explanations for any machine learning model.
https://interpretml.github.io/DiCE/
MIT License
1.37k stars 188 forks source link

Switching labels in Dice #445

Open Gradwanderer opened 1 month ago

Gradwanderer commented 1 month ago

I have trained a Binary classifier (0,1). Only the class 1 is of importance for me. So I use the model do predict the class of my test data and reduced the test data to all datapoints, where the predicted label was 1 and also the true label was 1.

I used that datapoints in the Dice package and the "Query instance (original outcome : 0)". That would not be that problem, but sometimes the package just switches that class for some data points.

Can you explain why the change happen? Does the package use the train data to predict the class? The Problem occure for the random and the genetic method. The problem occure for different models and is not fix for one type of classifier.