-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
The linkage_method() parameter function in tidyclust incorrectly labels the parameter as "activation" instead of "linkage_method" when used in grid creation functions like grid_regular().
Root Cause
File: R/dials-params.R
Line: 38
The linkage_method() function has a hardcoded label name:
linkage_method <- function(values = values_linkage_method) {
dials::new_qual_param(
type = "character",
values = values,
label = c(activation = "Linkage Method"), # ← Should be "linkage_method"
finalize = NULL
)
}Fix
Change line 38 from:
label = c(activation = "Linkage Method"),To:
label = c(linkage_method = "Linkage Method"),Impact
This forces users to manually rename the column with rename(linkage_method = activation) before using it with tune_cluster(), as shown in the current documentation and tutorials.
Reproducible Example
library(dials)
library(tidyclust)
# Current behavior - creates "activation" column instead of "linkage_method"
grid_regular(
num_clusters(range = c(2, 4)),
linkage_method(values = c("complete", "average", "ward.D2")),
levels = c(3, 3)
)
#> # A tibble: 9 × 2
#> num_clusters activation
#> <int> <chr>
#> 1 2 complete
#> 2 3 complete
#> 3 4 complete
#> # ... with 6 more rowsAfter the fix, it should produce:
#> # A tibble: 9 × 2
#> num_clusters linkage_method
#> <int> <chr>
#> 1 2 complete
#> 2 3 complete
#> 3 4 complete
#> # ... with 6 more rowsMetadata
Metadata
Assignees
Labels
No labels