MiShrinkAjust {MiDA} | R Documentation |
Ajust learning rate parameter for fitting generalized boosted regression modelsfor fitting generalized boosted regression models
Description
Test learning rate (shrinkage) parameter for microarrat data binary classification using gradient boosting over desicion trees.
Usage
MiShrinkAjust(Matrix, specimens, test.frac = 5, times = 5,
ntrees = 1000, shrinkage = c(0.001, 0.01, 0.1), intdepth = 2,
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 |
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 vector specifying the learning rate. Scales the step size in the gradient descent procedure. The tested parameter. |
intdepth |
vinteger specifying the maximum depth of each tree. |
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 MiIntDepthAjust
and MiNTreesAjust
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 shrinkage
value in each trial and their median.
test.accuracy
- a data frame of test data classification accuracy
for each shrinkage
value in each trial and their median.
Also a plot for shrinkage
versus Accuracy is produced.
Author(s)
Elena N. Filatova
See Also
gbm
, MiIntDepthAjust
, MiNTreesAjust
Examples
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 shrinkage
set.seed(1)
ClassRes<-MiShrinkAjust(SampleMatrix, SampleSpecimen, test.frac = 5, times = 3,
ntrees = 10, shrinkage = c(0.1, 1), intdepth = 2)
ClassRes[[1]] # train accuracy
ClassRes[[2]] # test accuracy