Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runs into issues when a feature column already named "tree" #31

Open
areeves87 opened this issue Sep 25, 2018 · 0 comments
Open

Runs into issues when a feature column already named "tree" #31

areeves87 opened this issue Sep 25, 2018 · 0 comments

Comments

@areeves87
Copy link

areeves87 commented Sep 25, 2018

Building the explainer relies on creating several new columns with names such as "tree" and "leaf". If those column names are already used in the training dataset, one can run into issues, specifically #23. In my case, I ran into this issue when using the explainer on a Natural Language Processing xgb model. My model was counting the instances of the word "tree" in the document within a column also named "tree".

The error is triggered when trying to row bind the tree_list_breakdown and tree_breakdown lists within the call to buildExplainerFromTreeList. A warning when the dataset already uses column names that include key terms such as "tree", "leaf", and "intercept" would be helpful. Perhaps written into the first few lines of the function.

Similarly, the explainPredictions function uses variable names that can cause issues. In my case, I had a column named "x" in my dataset that caused problems with the "x" used as the iterator in the for loop for going through all the trees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant