Description Usage Arguments Value Examples
This is the fast impelementation of the best split function when the leaf prediciton is coming from ridge regression.
1 2 | Find_ridge_best_split(feat, y, linear.idx, current.splitting.idx, lambda,
update_A_inv = update_A_inv_R)
|
feat |
all features |
y |
outcome vector |
linear.idx |
feature indexes where a Ridge Regression should be fitted |
current.splitting.idx |
the index of the feature we are currently testing for splits. |
It returns a vector of two doubles which determines what the best splitting point is, and what it's MSE is.
|
the best splitting value |
|
the best MSE |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | set.seed(309814)
n <- 1000
feat <- matrix(rnorm(4 * n), ncol = 4)
feat[2,] <- feat[which.min(feat[,2]),]
feat[3,] <- feat[which.min(feat[,2]),]
feat[4,] <- feat[which.min(feat[,2]),]
feat[5,] <- feat[which.min(feat[,2]),] - 1
y <- rnorm(n)
linear.idx <- 1:4
current.splitting.idx <- 2
lambda <- .2
Find_ridge_best_split_linear_MASS(feat = feat, y = y, linear.idx = linear.idx,
current.splitting.idx = current.splitting.idx,
lambda = lambda)
Find_ridge_best_split_slow(feat = feat, y = y, linear.idx = linear.idx,
current.splitting.idx = current.splitting.idx,
lambda = lambda)
Find_ridge_best_split(feat = feat, y = y, linear.idx = linear.idx,
current.splitting.idx = current.splitting.idx,
lambda = lambda)
# Note that fast split is not estimating the RSS or the MSE, but the RSS -
# sum(y^2).
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.