cluster_visits.Rd
Cluster visits for given specialty of doctors, based on embeddings of visits. The clustering is performed by the k-means algorithm.
cluster_visits(visits_vectors, visit_table, spec, cluster_number = 5, nstart = 50, iter.max = 15)
visits_vectors | A matrix of embeddings of visits |
---|---|
visit_table | A data frame with columns:
|
spec | A specialty to be clustered |
cluster_number | A number of desired clusters (default: 5) |
nstart | Optionally, |
inter.max | Optionally, |
The result of k-means with: cluster, centers etc.
#> 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 foundclusters <- cluster_visits(visits_vectors, visits, spec = "internist", cluster_number = 2L)#> Error in rownames(visits_vectors): object 'visits_vectors' not foundclusters$size#> Error in eval(expr, envir, enclos): object 'clusters' not found#> Error in eval(expr, envir, enclos): object 'clusters' not foundclusters$centers#> Error in eval(expr, envir, enclos): object 'clusters' not found