The finalize_*
functions take a list or tibble of tuning parameter values
and update objects with those values.
Arguments
- x
A recipe,
parsnip
model specification, or workflow.- parameters
A list or 1-row tibble of parameter values. Note that the column names of the tibble should be the
id
fields attached totune()
. For example, in theExamples
section below, the model hastune("K")
. In this case, the parameter tibble should be "K" and not "neighbors".
Examples
kmeans_spec <- k_means(num_clusters = tune())
kmeans_spec
#> K Means Cluster Specification (partition)
#>
#> Main Arguments:
#> num_clusters = tune()
#>
#> Computational engine: stats
#>
best_params <- data.frame(num_clusters = 5)
best_params
#> num_clusters
#> 1 5
finalize_model_tidyclust(kmeans_spec, best_params)
#> K Means Cluster Specification (partition)
#>
#> Main Arguments:
#> num_clusters = 5
#>
#> Computational engine: stats
#>