predict_distance_forest_matrix {SurvivalClusteringTree} | R Documentation |
Predict Distances Between Samples Based on a Survival Forest Fit (Data Supplied as Matrices)
Description
The function
predict_distance_forest_matrix
predicts distances between samples based on a survival forest fit.
Usage
predict_distance_forest_matrix(
survival_forest,
matrix_numeric,
matrix_factor,
missing = "omit"
)
Arguments
survival_forest |
a fitted survival forest |
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 Distances Between Samples Based on a Survival Forest Fit (Data Supplied as Matrices) (Works for raw matrices)
Value
A list.
mean_distance
is the mean distance matrix.
sum_distance
is the matrix that sums the distances between samples.
sum_non_na
is the matrix of the number of non NA distances being averaged.
Examples
library(survival)
a_survival_forest<-
survival_forest_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=F]),
nboot=20)
a_distance<-
predict_distance_forest_matrix(
a_survival_forest,
matrix_numeric=data.matrix(lung[,c(4,6:9),drop=FALSE]),
matrix_factor=data.matrix(lung[,5,drop=F]))