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

PublicData.get_decimal_precisions fails for very small or large numerical values #442

Open michael-t-alexander opened 3 months ago

michael-t-alexander commented 3 months ago

If the mode of a float type column is <= 1e-5 or >= 1e16, this line in get_decimal_precisions fails as the string representation of the mode uses scientific notation and doesn't contain a decimal point: https://github.com/interpretml/DiCE/blob/8027ebbf696e8b6c9344a889fb1ba4e90ea448d9/dice_ml/data_interfaces/public_data_interface.py#L396