Skip to content

Commit

Permalink
Fixed an issue that prevented hyperparameter optimisation of `xgboost…
Browse files Browse the repository at this point in the history
…` models for survival tasks.
  • Loading branch information
alexzwanenburg committed May 22, 2024
1 parent d3eb80d commit d484a1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions R/LearnerS4XGBoost.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit d484a1e

Please sign in to comment.