embed_visit: Generate an Embedding of a Visit

Description Usage Arguments Value See Also Examples

View source: R/visit_embeddings.R

Description

Generate an embedding of a given visit based on interview and examination descriptions and the embeddings of terms. This function calls embed_description function and merge the obtained embeddings of the interview and the examination.

Usage

1
embed_visit(visit_description, inter_term_vectors, exam_term_vectors)

Arguments

visit_description

A named two-element vector (names: "inter" and "exam") of concatenated terms of interview and examination. Terms must be separated by ", ".

inter_term_vectors

A matrix of embeddings of the interview terms

exam_term_vectors

A matrix of embeddings of the examination terms

Value

A vector of the embedding of the visit.

See Also

embed_description, embed_list_visits

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

embed_visit(c(inter = "", exam = "heart, woman, eye"),
  inter_term_vectors, exam_term_vectors)
embed_visit(c(inter = "cough",
             exam = "heart, woman, eye"),
           inter_term_vectors, exam_term_vectors)
embed_visit(c(inter = "cough", exam = ""),
           inter_term_vectors, exam_term_vectors)
embed_visit(c(inter = "", exam = "objaw chorobowy"),
           inter_term_vectors, exam_term_vectors)

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