You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When categorical columns contain numerical levels (e.g. yes - 1, no - 0) visualize_as_dataframe(show_only_changes=True) (and also visualize_as_list()) does not work, as it encodes the string values to numerical.
During data prep, categorical values are encoded as 'category' data type (see query instance below). The counterfactual uses numeric representation; hence it will show as 'changed' value even though it is the same category (e.g. '2' vs 2).
This is happening because train_data[cat_feature].cat.categories.tolist() returns integer and not categories/strings; for sample dataset above the categories and levels are:
DiCE/dice_ml/data_interfaces/private_data_interface.py
Line 336 in e9e7147
When categorical columns contain numerical levels (e.g. yes - 1, no - 0)
visualize_as_dataframe(show_only_changes=True)
(and alsovisualize_as_list()
) does not work, as it encodes the string values to numerical.Example dataset: https://archive.ics.uci.edu/ml/machine-learning-databases/00573/SouthGermanCredit.zip.
During data prep, categorical values are encoded as 'category' data type (see query instance below). The counterfactual uses numeric representation; hence it will show as 'changed' value even though it is the same category (e.g. '2' vs 2).
This is happening because
train_data[cat_feature].cat.categories.tolist()
returns integer and not categories/strings; for sample dataset above the categories and levels are:The text was updated successfully, but these errors were encountered: