loft-br / xgboost-survival-embeddings

Improving XGBoost survival analysis with embeddings and debiased estimators
https://loft-br.github.io/xgboost-survival-embeddings/
Apache License 2.0
313 stars 51 forks source link

Is it possible to pass the monotonic constraints to the fitting function #44

Closed brunocarlin closed 2 years ago

brunocarlin commented 2 years ago

Instructions

Describe the feature and the current state.

Currently this package seems to be one of the best ways to fit a xboost model to survival data, the only extension I would like to ask for is that the already existing parameter in xboost to restrain the trees for a monotonic constraint to be passed to the higher level function call.

Will this change a current behavior? How?

I think it only adds more functionality

Additional Information

https://xgboost.readthedocs.io/en/stable/tutorials/monotonic.html

brunocarlin commented 2 years ago

Ok I am closing it but if anyone ever wonders

` DEFAULT_PARAMS2 = { "objective": "survival:aft", "eval_metric": "aft-nloglik", "aft_loss_distribution": "normal", "aft_loss_distribution_scale": 1, "tree_method": "hist", "learning_rate": 5e-2, "max_depth": 8, "booster": "dart", "subsample": 0.5, "min_child_weight": 50, "colsample_bynode": 0.5, "monotone_constraints": (-1,-1,-1,-1,-1,-1,-1,1,1) }

fitting xgbse model

xgbse_model = XGBSEKaplanNeighbors(xgb_params=DEFAULT_PARAMS2,n_neighbors=50) xgbse_model.fit(X, y) `