assign_visit_to_cluster.Rd
Assign a given visit to the closest cluster from a given clustering. The function generates the embedding of the visit (by the function embed_visit) and computed the squared Euclidean distance from the clusters' centers.
assign_visit_to_cluster(visit_description, clusters, inter_term_vectors, exam_term_vectors)
visit_description | A named two element vector (with names: |
---|---|
clusters | An output of the function cluster_visits |
inter_term_vectors | A matrix of embeddings of the interview terms |
exam_term_vectors | A matrix of embeddings of the examination terms |
A list of:
cl
The number of the closest cluster
distances
The vector of distances to each cluster
#> 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)))#> 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#> Error in rownames(visits_vectors): object 'visits_vectors' not foundassign_visit_to_cluster(c(inter = "cough, fever, rhinitis", exam = ""), clusters, inter_term_vectors, exam_term_vectors)#> Error in ncol(term_vectors): object 'inter_term_vectors' not foundassign_visit_to_cluster(c(inter = "thyroid", exam = ""), clusters, inter_term_vectors, exam_term_vectors)#> Error in ncol(term_vectors): object 'inter_term_vectors' not foundassign_visit_to_cluster(c(inter = "cough, fever, rhinitis", exam = "patient, heart"), clusters, inter_term_vectors, exam_term_vectors)#> Error in ncol(term_vectors): object 'inter_term_vectors' not found