Find_ridge_best_split_linear_MASS: Find_ridge_best_split_linear_MASS

Description Usage Arguments Value Examples

View source: R/RidgeMSE.R

Description

Loops through all possible splits of feature current.splitting.idx. This is just a test function which uses the ridge regression canned ridge function of MASS

Usage

1
2
Find_ridge_best_split_linear_MASS(feat, y, linear.idx, current.splitting.idx,
  lambda)

Arguments

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.

Value

It returns a vector of two doubles which determines what the best splitting point is, and what it's MSE is.

split_val_best

the best splitting value

MSE_best

the best MSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(309814)
feat <- matrix(rnorm(80), ncol = 4)
y <- rnorm(20)
linear.idx <- 1:4
current.splitting.idx <- 2
lambda <- .2
Find_ridge_best_split_linear_MASS(
  feat = feat,
  y = y,
  current.splitting.idx = current.splitting.idx,
  linear.idx = linear.idx,
  lambda = lambda
)

theo-s/Rforestry_R documentation built on Dec. 23, 2021, 9:55 a.m.