nmf_cluster: Fit a Non-Negative Matrix Factorization Cluster

Description Usage Arguments Value Examples

Description

Fit a robust non-negative matrix factorization cluster to text data via rnmf. Prior to distance measures being calculated the tf-idf (see weightTfIdf) is applied to the DocumentTermMatrix.

Usage

1
2
3
4
nmf_cluster(x, k = k, ...)

## S3 method for class 'data_store'
nmf_cluster(x, k, ...)

Arguments

x

A data store object (see data_store).

k

The number of clusters.

...

Other arguments passed to rnmf.

Value

Returns an object of class "hclust".

Examples

 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
library(dplyr)

x <- with(
    presidential_debates_2012,
    data_store(dialogue, paste(person, time, sep = "_"))
)


## 6 topic model
model6 <- nmf_cluster(x, k=6)

model6 %>%
    assign_cluster()

model6 %>%
    assign_cluster() %>%
    summary()
## Not run: 
x2 <- presidential_debates_2012 %>%
    with(data_store(dialogue))

myfit2 <- nmf_cluster(x2, 55)

assign_cluster(myfit2)

assign_cluster(myfit2) %>%
    summary()

## End(Not run)

trinker/clustext documentation built on May 31, 2019, 8:41 p.m.