| hai_kmeans_obj | R Documentation |
Takes the output of the hai_kmeans_user_item_tbl() function and applies the
k-means algorithm to it using stats::kmeans()
hai_kmeans_obj(.data, .centers = 5) kmeans_obj(.data, .centers = 5)
.data |
The data that gets passed from |
.centers |
How many initial centers to start with |
Uses the stats::kmeans() function and creates a wrapper around it.
A stats k-means object
Steven P. Sanderson II, MPH
Other Kmeans:
hai_kmeans_automl_predict(),
hai_kmeans_automl(),
hai_kmeans_mapped_tbl(),
hai_kmeans_scree_data_tbl(),
hai_kmeans_scree_plt(),
hai_kmeans_tidy_tbl(),
hai_kmeans_user_item_tbl()
library(healthyR.data) library(dplyr) data_tbl <- healthyR_data %>% filter(ip_op_flag == "I") %>% filter(payer_grouping != "Medicare B") %>% filter(payer_grouping != "?") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() hai_kmeans_user_item_tbl( .data = data_tbl, .row_input = service_line, .col_input = payer_grouping, .record_input = record ) %>% hai_kmeans_obj()