interpretml / DiCE

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

DiCE on time-series data #148

Open Labaien96 opened 3 years ago

Labaien96 commented 3 years ago

Hi, I was wondering if DiCE works with continuous variables such as time-series data or not.

gaugup commented 3 years ago

I don't think DiCE library supports counterfactual generation for time series data as yet. CF for continuous variables is supported but not sure how do you capture the notion of time in your ML model.

@amit-sharma could shed more light on support for time series.

amit-sharma commented 3 years ago

@Labaien96 DiCE works for continuous features. So it will interpret the timeseries also as a (unordered) set of continuous features. There are ways to preprocess the data to make it work, but for that it is important to know the specific type of model you'd like to explain. Can you share some details on that? Does the model predict the next value of a timeseries?

Saladino93 commented 3 years ago

@amit-sharma do you have an example for this? I would be very interested!

gadhvirushiraj commented 3 months ago

@amit-sharma

I am also looking for making DiCE work on time-series. And it would be great if you can explain the data processing part you mentioned above.

In my scenario,I have a Bidirectional LSTM to predict values in a time series (specifically, yoga postures). I classify user actions incorrect based on a threshold (deviation between predicted and actual).

graph

I wish to generate counterfactual explanations for each error point, suggesting corrective actions for improvement. Because correcting individual features directly isn't ideal due to potential dependencies between features, which vary based on the user's posture. So, generating counterfactuals made sense but not sure on how to go about it using DiCE.

Thanks