martCV {mseq}R Documentation

cross-validation for MART

Description

Get the cross-validation R squared for MART.

Usage

martCV(data, fold = 5, seed = 281142, shrinkage = 0.06, interaction.depth = 10, n.trees = 2000, small_count = 0.5)

Arguments

data the data frame generated by expData.R
fold number of fold for CV
seed seed to generate training indexes
shrinkage the shrinkage argument of gbm
interaction.depth the interaction.depth argument of gbm
n.trees the n.trees argument of gbm
small_count the small count which will replace the zero count

Value

the CV R squared, a numeric value

Examples

 # read and expand the data
 data(g1_part) # for real data, please use read.csv, like g1 <- read.csv("g1.csv")
 data <- expData(g1_part, 2, 3) # In real datasets, surrounding sequences should be set longer.
 
 # To shorten the running time, this example uses small values of interaction.depth and n.trees. For real datasets, it is strongly suggested to use their default values.
 # get the CV R squared for MART
 R_sq <- martCV(data, interaction.depth = 2, n.trees = 100)

[Package mseq version 1.1 Index]