scikit-survival icon indicating copy to clipboard operation
scikit-survival copied to clipboard

Monotonicity constraint in Random Forest survival models

Open ogencoglu opened this issue 1 year ago • 1 comments

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 :

  • https://scikit-learn.org/stable/modules/ensemble.html#monotonic-cst-gbdt
  • https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html#sklearn.ensemble.RandomForestRegressor:~:text=in%20version%200.22.-,monotonic_cst,-array%2Dlike%20of

ogencoglu avatar Aug 08 '24 07:08 ogencoglu

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.

sebp avatar Aug 18 '24 19:08 sebp