Skip to content

Draft linear model residual splitting#691

Open
mnwright wants to merge 6 commits into
masterfrom
lmtree
Open

Draft linear model residual splitting#691
mnwright wants to merge 6 commits into
masterfrom
lmtree

Conversation

@mnwright

Copy link
Copy Markdown
Member

Quick and dirty implementation of splitting on residuals of linear models in the nodes. Usage examples:

ranger(Sepal.Length ~ ., iris, confounders = iris[, 5, drop = FALSE])
ranger(Sepal.Length ~ ., iris, confounders = iris[, 4:5], splitrule = "maxstat", alpha = 0.05)

@mnwright

Copy link
Copy Markdown
Member Author

Now the variable importance and prediction also uses the linear models:

rf <- ranger(Sepal.Length ~ ., iris, confounders = iris[, 5, drop = FALSE], importance = "permutation")
rf$variable.importance

To predict, also give the confounders to predict():

predict(rf, iris, confounders =  iris[, 5, drop = FALSE])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant