diff --git a/NEWS.md b/NEWS.md index 37a6d50d..369e87a2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ - Adapted tests to work when packages are missing. +- Fixed an issue that prevented hyperparameter optimisation of `xgboost` models for survival tasks. + # Version 1.4.7 (Uncertain Unicorn) ## Bug fixes diff --git a/R/LearnerS4XGBoost.R b/R/LearnerS4XGBoost.R index 804f6eb3..137f34dd 100644 --- a/R/LearnerS4XGBoost.R +++ b/R/LearnerS4XGBoost.R @@ -365,9 +365,7 @@ setMethod("get_prediction_type", signature(object="familiarXGBoost"), # The prediction type is a bit more complicated for xgboost methods. if(type == "default"){ - if(as.character(object@hyperparameters$learn_objective %in% c("cox"))){ - return("hazard_ratio") - } + return("hazard_ratio") } else if(type == "survival_probability"){ return("survival_probability")