Closed lintumk closed 3 years ago
Hi, CoxPH is just a method for fitting Cox proportional hazards models with pytorch. If you use a neural network, you get DeepSurv and if us use a linear model (neural network with only one layer an no non-linear transforms) you get the classical Cox Regression.
To get a linear model, I think you can just use
net = torch.nn.Linear(num_features, 1)
model = CoxPH(net, some_optimizer)
Does this answer your question?
Yes, Perfect! Thanks for this wonderful package and your timely reply.
Hi, In the example codes I see a single code for both Cox-PH and DeepSurv. I want to fit both the models for my data. How can I get both Classical Cox(linear) and DeepSur ?