From a888203ef78ecf9fcf813fd3a90ce4949f03a489 Mon Sep 17 00:00:00 2001 From: be-marc Date: Tue, 20 Feb 2024 10:10:04 +0100 Subject: [PATCH] fix: dependencies in default svm configuration --- R/LearnerClassifSVM.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/R/LearnerClassifSVM.R b/R/LearnerClassifSVM.R index afe5827c..0bfbdd34 100644 --- a/R/LearnerClassifSVM.R +++ b/R/LearnerClassifSVM.R @@ -94,8 +94,14 @@ default_values.LearnerClassifSVM = function(x, search_space, task, ...) { # noli gamma = 1 / length(task$feature_names) ) defaults = insert_named(default_values(x$param_set), special_defaults) - defaults[["degree"]] = NULL - defaults[search_space$ids()] + # defaults[["degree"]] = NULL + defaults = defaults[search_space$ids()] + + # fix dependencies + if (!is.null(defaults[["degree"]])) defaults[["degree"]] = NA_real_ + if (!is.null(defaults[["coef0"]])) defaults[["coef0"]] = NA_real_ + + defaults } #' @include aaa.R