powered by
augment() will add column(s) for predictions to the given data.
augment()
# S3 method for cluster_fit augment(x, new_data, ...)
A tibble::tibble() with containing new_data with columns added depending on the mode of the model.
tibble::tibble()
new_data
A cluster_fit object produced by fit.cluster_spec() or fit_xy.cluster_spec() .
cluster_fit
fit.cluster_spec()
fit_xy.cluster_spec()
A data frame or matrix.
Not currently used.
For partition models, a .pred_cluster column is added.
.pred_cluster
kmeans_spec <- k_means(num_clusters = 5) %>% set_engine("stats") kmeans_fit <- fit(kmeans_spec, ~., mtcars) kmeans_fit %>% augment(new_data = mtcars)
Run the code above in your browser using DataLab