rrotsfspls: rotsf rrotsfspls

Description Usage Arguments Value Author(s) References See Also Examples

Description

Grow a survival forest with partial least squares(PLS)

Usage

1
2
3
rrotsfspls(x, y, trlength = 100, mtry = floor(sqrt(ncol(x))),
  impute = TRUE, nplscomp = floor(sqrt(ncol(x))), vari_status = FALSE,
  ...)

Arguments

x

The covariates(predictor variables) of training data.

y

Survival time and censored status of training data. Must be a Surv survival object

trlength

The ensemle size (the number of base survival trees). Default is 100.

mtry

The number of covariates(predictor variables) used in each base tree model. Default is the square root of the number of all avaibable covariates.

vari_status

Whether or not calculate variables importance scores. Default is "FALSE".

...

Additional arguments for the base decision tree, see the rpart package for details.

Value

Object of class rrotsfspls with elements

pectrees A list of base models pecRpart in pec R package of size trlength. To retrieve a particular base model: use pectrees[[i]], where i takes values between 1 and trlength
colindexes A list of covaraite subspace index for each base tree.
trlength Number of bases models trained.
rotms A list of PLS weights matrix.To retrieve a particular weight matrix: use rotms[[i]], where i takes values between 1 and trlength
varimp If vari_status=FALSE, return a Matrix of variable importance scores.

Author(s)

Hong Wang and Lifeng Zhou

References

See Also

pec R package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
set.seed(123)
require(rotsf)
require(survival)
## Survival Forest with PLS  with default settings
#Lung DATA
data(lung)
lung=na.omit(lung)
lung[,3]=lung[,3]-1
n=dim(lung)[1]
L=sample(1:n,ceiling(n*0.5))
trset<-lung[L,]
teset<-lung[-L,]
rii=c(2,3)
plssurvmodel=rrotsfspls(x=trset[,-rii],y=Surv(trset[,rii[1]], trset[,rii[2]]))
# Get the 1th base model
firstbasemodel=plssurvmodel$pectrees[[1]]
#second PLS weight matrix
secondweigmatrix=plssurvmodel$rotms[[2]]
plssurvmodel2=rrotsfspls(x=trset[,-rii],y=Surv(trset[,rii[1]], trset[,rii[2]]),vari_status=TRUE)
#variable importance
varimpscores=plssurvmodel2$varimp

whcsu/rotsf documentation built on Dec. 4, 2019, 2:10 p.m.