sebp / scikit-survival

Survival analysis built on top of scikit-learn
GNU General Public License v3.0
1.13k stars 216 forks source link

Monotonicity constraint in Random Forest survival models #474

Open ogencoglu opened 3 months ago

ogencoglu commented 3 months ago

Monotonicity constraint is super useful when you have certain domain knowledge that "all else equal, a higher value in feature X should increase or decrease output Y". This is implemented in most frameworks including scikit-learn, xgboost, lightgbm.

I think this would be a great add.

Here is scikit-learn docs for monotonic_cst :

sebp commented 2 months ago

I'm not entirely sure how this would be implemented.

From the PR that add this feature to scikit-learn (https://github.com/scikit-learn/scikit-learn/pull/13649), it seems the splitting criterion has to implement check_monotonicity, clip_node_value, middle_value.

Currently, LogrankCriterion does not implement these methods.