-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the cox loss and methods with cutom model #51
Comments
Any model can use the CoxPHLoss. The loss will be:
To transform the data, please look at this example: https://github.com/lasso-net/lassonet/blob/master/examples/cox_experiments.py |
Thank you for your reply, If I have understood correctly, for a dataset one should do:
For instance, this should work if the dataset is save as the provided data: Once done that, you can split in training and test set: ''' Should I do anything for the data loader? and for the NN architecture (like which should be the last layer)? |
For y you should have both a duration and a boolean column for events. For the data loader, just use mini batches. The last layer should just output a real number, so a Linear layer is good. |
Thank you, I have done so:
It worked and loss is diminishing. As last question how you evaluate? How you should use with CI index? do you have some suggestions for evaluation? This is the most basically implementation of neural network with PyTorch, but I think it could work with any custom network (and it is using the data you provide). Do you want I will organize the script as tutorial? could be useful? |
You might want to look at the new Interval models, see the spinet example. |
Great work,
I found your approach very interesting and I was trying to generalize it to different pytorch architectures
I wanted to test your approach with custom models and other pytorch model. The idea is to basically take a pytorch model (arbitrary architecture) and test the ability to predict survival.
for example, I wanted to test with a simple pytorch model.
let' s say:
now, to better explain there is below:
What I am trying to understand is, considering this case:
taking this dataset and starting from your example:
this is a simple version of the approach modelling the survival as a simple binary classification approach:
The idea starting from very simple example to transform a model in able to handle censored data
I was highlighting this code from your repository:
Thank you very much
Salvatore
The text was updated successfully, but these errors were encountered: