Get_CVWeights: Parameter Tuning Weighting Function

Description Usage Arguments Value

Description

function to perform cross validation for tuning parameter alpha. Is setup to return OOB errors using all training cases, as well as only non-outliers, for weighted and unweighted cross validation The purpose of this function is to determine how much weight to give to training cases in the validation (or test) set used in parameter tuning for alpha. For a single rep and fold take training cases from training set (TRAIN1) and test (or validation) set(TRAIN 2). Grow forests on TRAIN1 and TRAIN2. Get OOB weights for cases in TRAIN1 using RF1, OOB weights for TRAIN2 using RF2 And prediction weights of cases in TRAIN1 on predictions for cases in TRAIN2 using RF1. Get OOB residuals for cases in TRAIN2 using RF2, using both RF and LOWESSRF Compute weights for cases in TRAIN2 using RF and RFL OOB residuals. These are the weights they'll be given in the cross validation used to assess alpha.

Usage

1
Get_CVWeights(TRAIN, TestInd, fold, ndsize, ntreestune)

Arguments

TRAIN

set of training data

TestInd

Matrix listing test cases in each fold of cross validation

fold

the fold being considered

ndsize

nodesize parameter value for random forest used in cross validation

ntreestune

number of trees to use for forests involved in parameter tuning

Value

a list of 6 elements samp - list of indexes of test (or validation) cases (i.e. TRAIN2) TRAINY - responses for all training cases OOBWeights1 - OOB prediction weights for training cases in TRAIN1 PredWeights1 - Prediction weights for predicting test (validation) cases using training cases BisqwtRF - Weight to be applied to each test or validation case when using cross validation to set tuning parameter, using RF outliers for downweighting BisqwtRFL- Weight to be applied to each test or validation case when using cross validation to set tuning parameter, using RFLOWESS outliers for downweighting


AndrewjSage/RFLOWESS documentation built on May 26, 2019, 6:38 a.m.