Description Usage Arguments Value Examples
Fit a skmean cluster to text data. Prior to distance measures being
calculated the tf-idf (see weightTfIdf
) is applied to the
DocumentTermMatrix
. Cosine dissimilarity is used to generate
the distance matrix supplied to skmeans
.
1 2 3 4 | skmeans_cluster(x, k, ...)
## S3 method for class 'data_store'
skmeans_cluster(x, k, ...)
|
x |
A data store object (see |
k |
The number of clusters. |
... |
Other arguments passed to |
Returns an object of class "skmean"
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | library(dplyr)
x <- with(
presidential_debates_2012,
data_store(dialogue, paste(person, time, sep = "_"))
)
## 6 topic model
myfit1 <- skmeans_cluster(x, k=6)
myfit1 %>%
assign_cluster()
myfit1 %>%
assign_cluster() %>%
summary()
## Not run:
x2 <- presidential_debates_2012 %>%
with(data_store(dialogue))
myfit2 <- skmeans_cluster(x2, 55)
assign_cluster(myfit2)
assign_cluster(myfit2) %>%
summary()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.