-
Notifications
You must be signed in to change notification settings - Fork 13
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
Example survival analysis #70
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I fixed some typos and it looks good to me, let's merge this :) |
Vincent-Maladiere
added a commit
that referenced
this pull request
Aug 20, 2024
…risk incidences (#53) * removing Incidence * adding MultiIncidence to hazardosu * reinserting example for multiincidence * Hardcode uniform time sampler to simplify estimator * Remove any reference to the dataset-specific oracle scorer * Rename to SurvivalBoost * Update the .score method to work in the any event setting * Rename test file * Fix test_gradient_boosting_incidence_parameter_tuning * Simplify code * Raise error if hard-zero resampling censors too many events * adding test * Refactor survival boost tests * Fix missing assertion * fix TODO * fix linter * Fix LaTeX * More informative error message for bad value for hard_zero_fraction * Remove untested code related to Cox PH based conditional censoring estimation * Avoid using 'Est' as a short hand for 'Estimator' * FIX accept both float and array-like for time_horizon in predict_proba * DOC update predict_proba docstring * TST add a test that check the behaviour of predict_proba * DOC add docstring to test * TST check that probability sum to one for all events * DOC fix docstring type for time_horizon * Rename BaseIPCW to KaplanMeierIPCW. Adding some documentation. * API correct the API of predict_proba * Use arturo formulation * Silence 'DeprecationWarning: invalid escape sequence' by using raw docstrings with LaTeX expressions * update docstring * Simplify KaplanMeierIPCW and improve its docstring * adding some documentation to SurvivalBoost * More docstring fixes * Apply suggestions from code review Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> * TST update test and code to follow scikit-learn convention * TST check that we override properly * Apply suggestions from code review Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> * DOC start documenting parameter * DOC documents parameters in SurvivalBoost docstring * DOC add ipcw estimator docstring * DOC add attributes, reference, and examples * DOC document some parameters and attributes of WeightedMultiClassTargetSampler * API change the shape of the incidence curves * DOC Use data generator in marginal cumulative incidence example * FIX slice properly the prediction * fix install instructions with flit * MAINT Remove old python version in black config (#57) * MAINT activate doctest check with pytest by default * Fix a pandas warning in load_seer * FIX do not pytest collect outside of the hazardous module folder * FIX update the example to integrate on the right columns * Apply suggestions from code review Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> * Set explicit value for n_events * Improve variable names and comments in WeightedMultiClassTargetSampler * Use n_horizons_per_observation=3 by default * Update hazardous/_survival_boost.py * Remove reference to "column" to describe the second axis of a 3D array. * Improve docstrings for SurvivalBoost * Make sure to use zero-width param ranges in marginal example * Silence AJ warning on tied events * Small improvements * Use a string in the public API of SurvivalBoost to select the censoring estimator * Keep IPCW estimator private API for now * replacing any occurence of _est to _estimator * fixing math, harmonising different notations. * Example survival analysis (#70) * survival analysis example * change the `predict_cumutive_incidence` function to `predict_survival_function` * fix the example and adapt it to sphinx * add torch to doc deps because because pycox doesn't require it * clean example --------- Co-authored-by: LeoGrin <leo.grinsztajn@polytechnique.edu> Co-authored-by: Vincent Maladiere <maladiere.vincent@yahoo.fr> * enhance documentation --------- Co-authored-by: Julie Alberge <julie.alberge@gmail.com> Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai> Co-authored-by: ArturoAmorQ <arturo.amor-quiroz@polytechnique.edu> Co-authored-by: Judith Abecassis <judithabk6@users.noreply.github.com> Co-authored-by: Jovan Stojanovic <62058944+jovan-stojanovic@users.noreply.github.com> Co-authored-by: Julie <107467312+juAlberge@users.noreply.github.com> Co-authored-by: LeoGrin <leo.grinsztajn@polytechnique.edu> Co-authored-by: Vincent Maladiere <maladiere.vincent@yahoo.fr>
github-actions bot
pushed a commit
that referenced
this pull request
Aug 20, 2024
…competing risk incidences (#53) * removing Incidence * adding MultiIncidence to hazardosu * reinserting example for multiincidence * Hardcode uniform time sampler to simplify estimator * Remove any reference to the dataset-specific oracle scorer * Rename to SurvivalBoost * Update the .score method to work in the any event setting * Rename test file * Fix test_gradient_boosting_incidence_parameter_tuning * Simplify code * Raise error if hard-zero resampling censors too many events * adding test * Refactor survival boost tests * Fix missing assertion * fix TODO * fix linter * Fix LaTeX * More informative error message for bad value for hard_zero_fraction * Remove untested code related to Cox PH based conditional censoring estimation * Avoid using 'Est' as a short hand for 'Estimator' * FIX accept both float and array-like for time_horizon in predict_proba * DOC update predict_proba docstring * TST add a test that check the behaviour of predict_proba * DOC add docstring to test * TST check that probability sum to one for all events * DOC fix docstring type for time_horizon * Rename BaseIPCW to KaplanMeierIPCW. Adding some documentation. * API correct the API of predict_proba * Use arturo formulation * Silence 'DeprecationWarning: invalid escape sequence' by using raw docstrings with LaTeX expressions * update docstring * Simplify KaplanMeierIPCW and improve its docstring * adding some documentation to SurvivalBoost * More docstring fixes * Apply suggestions from code review Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> * TST update test and code to follow scikit-learn convention * TST check that we override properly * Apply suggestions from code review Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> * DOC start documenting parameter * DOC documents parameters in SurvivalBoost docstring * DOC add ipcw estimator docstring * DOC add attributes, reference, and examples * DOC document some parameters and attributes of WeightedMultiClassTargetSampler * API change the shape of the incidence curves * DOC Use data generator in marginal cumulative incidence example * FIX slice properly the prediction * fix install instructions with flit * MAINT Remove old python version in black config (#57) * MAINT activate doctest check with pytest by default * Fix a pandas warning in load_seer * FIX do not pytest collect outside of the hazardous module folder * FIX update the example to integrate on the right columns * Apply suggestions from code review Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> * Set explicit value for n_events * Improve variable names and comments in WeightedMultiClassTargetSampler * Use n_horizons_per_observation=3 by default * Update hazardous/_survival_boost.py * Remove reference to "column" to describe the second axis of a 3D array. * Improve docstrings for SurvivalBoost * Make sure to use zero-width param ranges in marginal example * Silence AJ warning on tied events * Small improvements * Use a string in the public API of SurvivalBoost to select the censoring estimator * Keep IPCW estimator private API for now * replacing any occurence of _est to _estimator * fixing math, harmonising different notations. * Example survival analysis (#70) * survival analysis example * change the `predict_cumutive_incidence` function to `predict_survival_function` * fix the example and adapt it to sphinx * add torch to doc deps because because pycox doesn't require it * clean example --------- Co-authored-by: LeoGrin <leo.grinsztajn@polytechnique.edu> Co-authored-by: Vincent Maladiere <maladiere.vincent@yahoo.fr> * enhance documentation --------- Co-authored-by: Julie Alberge <julie.alberge@gmail.com> Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai> Co-authored-by: ArturoAmorQ <arturo.amor-quiroz@polytechnique.edu> Co-authored-by: Judith Abecassis <judithabk6@users.noreply.github.com> Co-authored-by: Jovan Stojanovic <62058944+jovan-stojanovic@users.noreply.github.com> Co-authored-by: Julie <107467312+juAlberge@users.noreply.github.com> Co-authored-by: LeoGrin <leo.grinsztajn@polytechnique.edu> Co-authored-by: Vincent Maladiere <maladiere.vincent@yahoo.fr> 5e581d5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding an example of survival analysis using SurvivalBoost on one dataset on
pycox
.