Skip to content

Commit

Permalink
party -> partykit
Browse files Browse the repository at this point in the history
  • Loading branch information
thothorn committed Apr 12, 2018
1 parent caca2ff commit eeed5d8
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions vignettes/SurvivalEnsembles.Rnw
Expand Up @@ -11,7 +11,7 @@
%%\usepackage{Sweave}

%%\VignetteIndexEntry{Survival Ensembles}
%%\VignetteDepends{mboost, survival, rpart, TH.data}
%%\VignetteDepends{mboost, survival, rpart, TH.data, partykit}

\newcommand{\Rpackage}[1]{{\normalfont\fontseries{b}\selectfont #1}}
\newcommand{\Robject}[1]{\texttt{#1}}
Expand Down Expand Up @@ -160,11 +160,14 @@ AMLw <- AMLw[AMLw > 0 & cc]
Fit random forest for censored data
<<AML-RF, echo = TRUE>>=
### controls for tree growing
ctrl <- cforest_control(mincriterion = 0.1, mtry = 5, minsplit = 5, ntree = 250)
ctrl <- ctree_control(testtype = "Teststatistic",
teststat = "maximum", mincriterion = .1, minsplit = 5)
### was: cforest_control(mincriterion = 0.1, mtry = 5, minsplit = 5, ntree = 250)
### fit random forest for censored data (warnings are OK here)
AMLrf <- cforest(I(log(time)) ~ ., data = AMLlearn, control = ctrl,
weights = AMLw)
AMLrf <- cforest(log(time) ~ ., data = AMLlearn, control = ctrl,
weights = AMLw, mtry = 5, ntree = 250,
perturb = list(replace = TRUE, fraction = 0.632))
@
and $L_2$Boosting for censored data
<<AML-boost, echo = TRUE>>=
Expand Down Expand Up @@ -253,12 +256,18 @@ TRmod <- rpart(ltime ~ . , data = GBSG2learn, weights = GBSG2w,
TRerisk <- sum((GBSG2learn$ltime[pos] - predict(TRmod))^2*GBSG2w[pos]) / n
### tree controls
ctrl <- cforest_control(mincriterion = qnorm(0.95), mtry = 5,
minsplit = 5, ntree = 100)
ctrl <- ctree_control(testtype = "Teststatistic",
teststat = "maximum", mincriterion = qnorm(.95),
minsplit = 5)
### was: cforest_control(mincriterion = qnorm(0.95), mtry = 5,
### minsplit = 5, ntree = 100)
### fit random forest for censored data (warnings are OK here)
RFmod <- cforest(ltime ~ . , data = GBSG2learn, weights = GBSG2w,
control = ctrl)
control = ctrl, mtry = 5, ntree = 100,
perturb = list(replace = TRUE,
fraction = 0.632 * sum(GBSG2w > 0)))
### fit L2 boosting for censored data
L2Bmod <- glmboost(ltime ~ ., data = GBSG2learn, weights = GBSG2w,
Expand Down

0 comments on commit eeed5d8

Please sign in to comment.