DiCE icon indicating copy to clipboard operation
DiCE copied to clipboard

Support for non-numeric classes

Open shreyakhandelwal07 opened this issue 4 years ago • 3 comments

Currently, it seems that DiCE only supports numeric classes. Are you planning to support non numeric classes as well?

shreyakhandelwal07 avatar Sep 07 '21 11:09 shreyakhandelwal07

@shreyakhandelwal07 could you elaborate more on numeric classes bit?

Regards,

gaugup avatar Sep 07 '21 21:09 gaugup

For instance, my dataset has 3 classes - 'Car', 'Truck', 'Bike'. DiCE expects the desired class for the counterfactuals to be numeric. elif isinstance(desired_class_input, int): if desired_class_input >= 0 and desired_class_input < num_output_nodes: target_class = desired_class_input return target_class else: raise UserConfigValidationException("Desired class not present in training data!") else: raise UserConfigValidationException("The target class for {0} could not be identified".format( desired_class_input))

So when I choose my desired class as 'Car', I get an error that the target class for Car could not be identified

shreyakhandelwal07 avatar Sep 08 '21 10:09 shreyakhandelwal07

Thanks for raising this @shreyakhandelwal07 Agree, this can be a useful feature for classification models. However, it may require specific logic for handling strings in many places. We will look to support it in a future release.

amit-sharma avatar Oct 10 '21 12:10 amit-sharma