get_cluster_recommendations: Get Recommendations for Clusters

Description Usage Arguments Value Examples

View source: R/clustering.R

Description

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

Usage

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
inter_term_vectors <- embed_terms(interviews, embedding_size = 10L,
                                  term_count_min = 1L)
exam_term_vectors <- embed_terms(examinations, embedding_size = 10L,
                                 term_count_min = 1L)
visits_vectors <- embed_list_visits(interviews,
                                    examinations, inter_term_vectors, exam_term_vectors)
clusters <- cluster_visits(visits_vectors, visits,
                           spec = "internist",
                           cluster_number = 2L)

get_cluster_recommendations(recommendations, clusters, recom_table = terms_categories)
get_cluster_recommendations(recommendations, clusters, recom_table = terms_categories,
category = "anatomic")
get_cluster_recommendations(recommendations, clusters, recom_table = terms_categories,
category = "all")

adamgdobrakowski/memr documentation built on Sept. 4, 2021, 3:45 a.m.