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
If you try to fit multiple datasets, even tough they have the same number of features, I recommend you to define and fit a new explainer.
Although I am not entirely sure that I understood exactly your workflow, I suspect that the error comes from the difference in the number of categories within the columns. To give you an example, suppose that we have an initial dataset in which the first categorical column has only 2 categories (e.g., gender taking the values male or female), and another dataset in which the first categorical column has 4 categories (e.g., color taking values red, yellow, blue, green). As you can observe, the one-hot-encoding representation differ for those two. Even more, although you can have the same number of features in the raw representations of the datasets (e.g., label encoding), the number of columns can differ in the one hot encoding because of the difference in the number of categories within each feature.
This error can occur because the metadata of the dataset is provided at initialization and not at the fit step (e.g., feature_names, category_map are provided to __init__ method). That metadata is used to construct the conditional vector.
Again, I am not sure if this is the case for you since I see some grouping based on the prediction of the model. It would be great if you can provide some runnable code so I can reproduce the error locally and understand better your use case. You can replace the data with some dummy data (randomly generated).
Problem Statement:
Code Snippet is as below:
The text was updated successfully, but these errors were encountered: