hai_umap_list: UMAP Projection

View source: R/umap-list.R

hai_umap_listR Documentation

UMAP Projection

Description

Create a umap object from the uwot::umap() function.

Usage

hai_umap_list(.data, .kmeans_map_tbl, .k_cluster = 5)

umap_list(.data, .kmeans_map_tbl, .k_cluster = 5)

Arguments

.data

The data from the hai_kmeans_user_item_tbl() function.

.kmeans_map_tbl

The data from the hai_kmeans_mapped_tbl().

.k_cluster

Pick the desired amount of clusters from your analysis of the scree plot.

Details

This takes in the user item table/matix that is produced by hai_kmeans_user_item_tbl() function. This function uses the defaults of uwot::umap().

Value

A list of tibbles and the umap object

Author(s)

Steven P. Sanderson II, MPH

See Also

Other UMAP: hai_umap_plot()

Examples

library(healthyR.data)
library(dplyr)
library(broom)

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()

uit_tbl <- hai_kmeans_user_item_tbl(
  .data = data_tbl,
  .row_input = service_line,
  .col_input = payer_grouping,
  .record_input = record
)

kmm_tbl <- hai_kmeans_mapped_tbl(uit_tbl)

umap_list(.data = uit_tbl, kmm_tbl, 3)


healthyR.ai documentation built on April 3, 2023, 5:24 p.m.