Skip to main content

`init` (CoxPH)

  • Available in: CoxPH
  • Hyperparameter: no

Description​

When building a CoxPH model, the init option specifies the initial value, β(0)\beta^{(0)}, for the coefficient vector. This value defaults to 0.

  • None

Example​

library(h2o)
h2o.init()

# import the heart dataset
heart <- h2o.importFile("http://s3.amazonaws.com/h2o-public-test-data/smalldata/coxph_test/heart.csv")

# split the dataset into train and validation datasets
heart_split <- h2o.splitFrame(data = heart, ratios = 0.8, seed = 1234)
train <- heart_split[[1]]
test <- heart_split[[2]]

# train your model
coxph_model <- h2o.coxph(x = "age",
event_column = "event",
start_column = "start",
stop_column = "stop",
training_frame = heart,
init = 3)

# view the model details
coxph_model
Loading required namespace: survival
Model Details:
==============

H2OCoxPHModel: coxph
Model ID: CoxPH_model_R_1570809926481_1
Call:
Surv(start, stop, event) ~ age

coef exp(coef) se(coef) z p
age 0.0307 1.0312 0.0143 2.15 0.031

Likelihood ratio tes = 6109 on 1 df, p =< 2e-16
n = 172, number of events = 75

Feedback