DiCE
DiCE copied to clipboard
error "unexpected keyword argument 'desired_range'" for TF regression models
Hello,
I have a DNN model built in Keras and TensorFlow with a regression output. When I call the
generate_counterfactuals function, I receive the error:
TypeError: generate_counterfactuals() got an unexpected keyword argument 'desired_range'
The code that generates the error is:
backend = "TF" + tf.__version__[0] # TF2
dice_data = dice_ml.Data(dataframe=dice_data, continuous_features=features, outcome_name=outcome)
dnn_dice = dice_ml.Model(model=dnn_model, backend=backend, model_type="regressor")
dice_cf = exp.generate_counterfactuals(query_instance=X_test[:1000], total_CFs=2, desired_range=[0.01, 0.1])
System info: Google Colab Python 3.7.13 dice-ml 0.7.2 keras 2.8.0 tensorflow 2.8.0
@ddefranza it looks like we don't support desired_range for TF2. @amit-sharma are there any plans to support regression for TF2 models soon?
yeah, this is a work-in-progress for TF models. At this point, it might be end-June by which we can support this.
Hello, it's not able to use "desired range" for TF models. Will it be available soon? @amit-sharma
this got deprioritized, unfortunately. We welcome contributions--if you would like to contribute, that will be great.