MiIntDepthAjust {MiDA}R Documentation

Ajust maximum depth parameter for fitting generalized boosted regression models

Description

Test maximum depth parameter for microarray data binary classification using gradient boosting over desicion trees.

Usage

MiIntDepthAjust(Matrix, specimens, test.frac = 5, times = 5,
  ntrees = 1000, shrinkage = 0.1, intdepth = c(1:4),
  n.terminal = 10, bag.frac = 0.5)

Arguments

Matrix

numeric matrix of expression data where each row corresponds to a probe (gene, transcript), and each column correspondes to a specimen (patient).

specimens

factor vector with two levels specifying specimens in the columns of the Matrix

test.frac

integer specifying fraction of data to use for model testing

times

integer specifying number of trials

ntrees

integer specifying the total number of decision trees (boosting iterations).

shrinkage

numeric specifying the learning rate. Scales the step size in the gradient descent procedure.

intdepth

vector of integers specifying the maximum depth of each tree. The tested parameter.

n.terminal

integer specifying the actual minimum number of observations in the terminal nodes of the trees.

bag.frac

the fraction of the training set observations randomly selected to propose the next tree in the expansion.

Details

test.frac defines fraction of specimens that will be used for model testing. For example, if test.frac=5 then 4/5th of specimens will be used for model fitting (train data) and 1/5th of specimens will be used for model testing (test data). Specimens for test and train data will be selected by random. So with times>1, train and test data will differ each time.
While boosting basis functions are iteratively adding in a greedy fashion so that each additional basis function further reduces the selected loss function. Gaussian distribution (squared error) is used. ntrees, shrinkage, intdeep are parameters for model tuning. bag.frac introduces randomnesses into the model fit. If bag.frac < 1 then running the same model twice will result in similar but different fits. Number of specimens in train sample must be enough to provide the minimum number of observations in terminal nodes.I.e.
(1-1/test.frac)*bag.frac > n.terminal.
See gbm for details.
Use MiNTreesAjust and MiShrinkAjust for ajusting other parameters.
Function is rather time-costing. If specimens are not equally distributed between two classified groups, NA may be produced.

Value

list of 2
train.accuracy - a data frame of train data classification accuracy for each intdepth value in each trial and their median.
test.accuracy - a data frame of test data classification accuracy for each intdepth value in each trial and their median.
Also a plot for intdepth versus Accuracy is produced.

Author(s)

Elena N. Filatova

See Also

gbm, MiNTreesAjust, MiShrinkAjust

Examples

#get gene expression and specimen data
data("IMexpression");data("IMspecimen")
#sample expression matrix and specimen data for binary classification,
#only "NORM" and "EBV" specimens are left
SampleMatrix<-MiDataSample(IMexpression, IMspecimen$diagnosis,"norm", "ebv")
SampleSpecimen<-MiSpecimenSample(IMspecimen$diagnosis, "norm", "ebv")
#Fitting, low tuning for faster running. Test intdepth
set.seed(1)
ClassRes<-MiIntDepthAjust(SampleMatrix, SampleSpecimen, test.frac = 5, times=3,
                          ntrees = 10, shrinkage = 1, intdepth =  c(1,2))
ClassRes[[1]] # train accuracy
ClassRes[[2]] # test accuracy


[Package MiDA version 0.1.2 Index]