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

explainPredictions always uses maximum number of trees #15

Open
ChoGit opened this issue Jan 14, 2018 · 0 comments
Open

explainPredictions always uses maximum number of trees #15

ChoGit opened this issue Jan 14, 2018 · 0 comments

Comments

@ChoGit
Copy link

ChoGit commented Jan 14, 2018

Hi David and thank you for this useful explainer. I must point out that I stepped into an issue with explainPredictions function.
The number of iterations of for loop is defined by lines
54: nodes = predict(xgb.model,data,predleaf =TRUE)
and
61: num_trees = ncol(nodes)
None of this lines takes into account the number of trees used to built the explainer variable and so num_trees is always equal to the total number of trees present into the model, even thou when I called buildExplainer I set the input variable n_first_tree to a lower value. In this case, after n_first_tree iterations the for loop start adding NAs to preds_breakdown producing a NAs-Only output.

@ChoGit ChoGit changed the title explainPredictions always use maximum number of trees explainPredictions always uses maximum number of trees Jan 14, 2018
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

Successfully merging a pull request may close this issue.

1 participant