Skip to content

Commit

Permalink
fix: replace and with or in check_centers
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muecke committed Feb 5, 2024
1 parent 0db0671 commit d90e4d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/LearnerClustKMeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ LearnerClustKMeans = R6Class("LearnerClustKMeans",
#' Creates a new instance of this [R6][R6::R6Class] class.
initialize = function() {
ps = ps(
centers = p_uty(tags = c("required", "train"), default = 2L, custom_check = crate(check_centers), ),
centers = p_uty(tags = c("required", "train"), default = 2L, custom_check = crate(check_centers)),
iter.max = p_int(lower = 1L, default = 10L, tags = c("train")),
algorithm = p_fct(levels = c("Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"), default = "Hartigan-Wong", tags = c("train")),
nstart = p_int(lower = 1L, default = 1L, tags = c("train")),
Expand Down
2 changes: 1 addition & 1 deletion R/helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ check_centers_param = function(centers, task, test_class, name) {
}

check_centers = function(x) {
if (test_data_frame(x) && test_int(x, lower = 1L)) {
if (test_data_frame(x) || test_int(x, lower = 1L)) {
TRUE
} else {
"`centers` must be integer or data.frame with initial cluster centers"
Expand Down

0 comments on commit d90e4d2

Please sign in to comment.