Skip to content

Add features argument to only include certain features#13

Closed
mnwright wants to merge 6 commits intomasterfrom
feature_subsets
Closed

Add features argument to only include certain features#13
mnwright wants to merge 6 commits intomasterfrom
feature_subsets

Conversation

@mnwright
Copy link
Copy Markdown
Contributor

Example:

library(glex)
library(xgboost)

x <- as.matrix(mtcars[, -1])
y <- mtcars$mpg

xg <- xgboost(data = x, label = y, params = list(max_depth = 4, eta = .1), nrounds = 100, verbose = 0)

glex(xg, x, features = c("cyl", "disp"))

The SHAP values are not correct anymore if we use this. But we should have the same problem with max_interaction?

@jemus42
Copy link
Copy Markdown
Collaborator

jemus42 commented Jan 11, 2024

Interesting idea, kind of a natural extension to the max_interaction situation I guess.
We could analogously calculate a remainder term, or add to the existing remainder term.
It becomes a bit wonky at the point where we limit glex() in both max_interaction and included features, at which point the remainder term sucks up both higher order interactions and entire features 🤔

Off the top of my head I'm not sure if I completed the remainder term stuff for both xgboost and rpf or just rpf, but I'd like to note that handling that is unfortunately quite fiddly, especially for the multiclass case 🫠

@jemus42
Copy link
Copy Markdown
Collaborator

jemus42 commented Mar 16, 2024

Is this also superseded by #17?

@mnwright
Copy link
Copy Markdown
Contributor Author

Yes, just a small thing that is in #18 now.

@mnwright mnwright closed this Mar 19, 2024
@mnwright
Copy link
Copy Markdown
Contributor Author

Wait, what about the tests?

@mnwright mnwright reopened this Mar 19, 2024
@jemus42
Copy link
Copy Markdown
Collaborator

jemus42 commented Mar 19, 2024

The tests in "tests/testthat/test-glex-xgboost.R" are in master, seems about right.

@jemus42 jemus42 closed this Mar 19, 2024
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 this pull request may close these issues.

2 participants