predict_weights_matrix {SurvivalClusteringTree} | R Documentation |
Predict Weights of Samples in Terminal Nodes Based on a Survival Tree Fit (Data Supplied as Matrices)
Description
The function
predict_weights_matrix
predicts weights of samples in terminal nodes based on a survival tree fit.
Usage
predict_weights_matrix(
survival_tree,
matrix_numeric,
matrix_factor,
missing = "majority"
)
Arguments
survival_tree |
a fitted survival tree |
matrix_numeric |
numeric predictors, a numeric matrix.
|
matrix_factor |
factor predictors, a character matrix.
|
missing |
a character value that specifies the handling of missing data.
If |
Details
Predict Weights of Samples in Terminal Nodes Based on a Survival Tree Fit (Data Supplied as Matrices)
Value
A weight matrix representing the weights of samples in each node.
Examples
library(survival)
a_survival_tree<-
survival_tree_matrix(
time=lung$time,
event=lung$status==2,
matrix_numeric=data.matrix(lung[,c(4,6:9),drop=FALSE]),
matrix_factor=data.matrix(lung[,5,drop=FALSE]))
a_weight<-
predict_weights_matrix(
a_survival_tree,
matrix_numeric=data.matrix(lung[,c(4,6:9),drop=FALSE]),
matrix_factor=data.matrix(lung[,5,drop=FALSE]))