Get recommendations prescribed by doctors to patients from given clusters. The categories of recommendation terms can be specified.

get_cluster_recommendations(recom_descriptions, clusters,
  category = "all", recom_table)

Arguments

recom_descriptions

A vector of descriptions of recommendations, named by visits' IDs; terms in the descriptions are separated by ", "

clusters

An output of the function cluster_visits

category

A vector of categories of the terms to be returned or "all" (default: "all")

recom_table

(necessary if category != "all") A data frame with columns:

term

a term of recommendation

category

a category of the term

Value

A list of data frames. For each cluster there is a data frame with columns:

recommendation

A term of recommendation

count

A number of occurrences of the recommentadion in the cluster

frequency

A percentage of visits containing the reccomentation

Rows are sorted by the frequency.

Examples

inter_term_vectors <- embed_terms(interviews, embedding_size = 10L, term_count_min = 1L)
#> Error in .subset2(public_bind_env, "initialize")(...): unused arguments (word_vectors_size = 10, vocabulary = list(c("fever", "rhinitis", "cough", "eye", "thyroid"), c(3, 3, 4, 4, 6), c(3, 3, 4, 4, 6)))
exam_term_vectors <- embed_terms(examinations, embedding_size = 10L, term_count_min = 1L)
#> Error in .subset2(public_bind_env, "initialize")(...): unused arguments (word_vectors_size = 10, vocabulary = list(c("fever", "man", "mother", "cough", "heart", "patient", "thyroid", "eye", "rhinitis", "woman", "father"), c(2, 2, 2, 3, 3, 3, 3, 4, 5, 6, 7), c(2, 2, 2, 3, 3, 3, 3, 4, 5, 6, 7)))
visits_vectors <- embed_list_visits(interviews, examinations, inter_term_vectors, exam_term_vectors)
#> Error in ncol(term_vectors): object 'inter_term_vectors' not found
clusters <- cluster_visits(visits_vectors, visits, spec = "internist", cluster_number = 2L)
#> Error in rownames(visits_vectors): object 'visits_vectors' not found
get_cluster_recommendations(recommendations, clusters, recom_table = terms_categories)
#> Error in nrow(clusters$centers): object 'clusters' not found
get_cluster_recommendations(recommendations, clusters, recom_table = terms_categories, category = "anatomic")
#> Error in nrow(clusters$centers): object 'clusters' not found
get_cluster_recommendations(recommendations, clusters, recom_table = terms_categories, category = "all")
#> Error in nrow(clusters$centers): object 'clusters' not found