When we are using this type of feature preprocessing 'dataset["Sex"] = dataset.Sex.astype("category")', the dataset will contain the string value, like 'male', but lightgbm will convert it to its int representation, like '1'.
When dtreeviz is using the prediction path to search the path through the tree for a sample, where will be a mismatch of values, like 'is "male" in [1]?'. This will cause the node_samples to have wrong samples and make the view() to fail.
You can reproduce the issue by using this dataset for training.
When we are using this type of feature preprocessing 'dataset["Sex"] = dataset.Sex.astype("category")', the dataset will contain the string value, like 'male', but lightgbm will convert it to its int representation, like '1'.
When dtreeviz is using the prediction path to search the path through the tree for a sample, where will be a mismatch of values, like 'is "male" in [1]?'. This will cause the node_samples to have wrong samples and make the view() to fail.
You can reproduce the issue by using this dataset for training.