alibi icon indicating copy to clipboard operation
alibi copied to clipboard

CFRL shape inconsistencies in the target/label arrays

Open RobertSamoilescu opened this issue 3 years ago • 0 comments

I observed that for CFRL, when we return the explanation object, the labels for the counterfactuals stored in explanation.data['cf']['class'] (we denote those by y_cf) have a shape of (N, 1), where N is the number of data instances for which a counterfactual was generated. Since the true target might have the shape (N, ) (we denote those by y_target), it is possible that if you compare them as y_cf == y_target you would end up with a tensor of shape (N, N) which compares every counterfactual class with every target class. Taking the mean will lead to an incorrect performance computation.

Would be great to address this to have some consistency in the tensor shapes.

RobertSamoilescu avatar Oct 25 '22 10:10 RobertSamoilescu