sebp / scikit-survival

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

[BUG] `GradientBoostingSurvivalAnalysis` - docstring/logic mismatch on possible `criterion` values #448

Closed fkiraly closed 6 months ago

fkiraly commented 6 months ago

In GradientBoostingSurvivalAnalysis, docstring and logic do not agree on the set of possible criterion values.

Docstring implies that "friedman_mse", "mse", and "mae" are valid, but passing "mse" or "mae" triggers a ValueError which says that only "friedman_mse" and "squared_error" are valid.

Indeed, the constraints from BaseGradientBoosting have "criterion": [StrOptions({"friedman_mse", "squared_error"})],.

This seems consistent with the construction of DecisionTreeRegressor under the hood (which would allow additional options, though).

sebp commented 6 months ago

You are right that sklearn.tree.DecisionTreeRegressor does support "absolute_error" and "poisson", however the gradient boosting models in sklearn do not, e.g. sklearn.ensemble.GradientBoostingClassifier. Not sure why, but I would stick to the same options that gradient boosting models in sklearn support.