-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathanalyze.r
20 lines (17 loc) · 908 Bytes
/
analyze.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
library(plyr)
library(lda)
productive <- read.csv("cool_objects.csv", header=F)
colnames(productive) <- c("Person", "Thing", "Description", "URL")
productive_doclines <- ddply(.data=productive, c("Person"),
summarise,
things = paste(Thing, collapse=";")
#doclines = paste(Object, collapse=";")
)
lexical_doclines <- lexicalize(doclines=productive_doclines$things, sep=";")
lda_result <- lda.collapsed.gibbs.sampler(documents=lexical_doclines$documents,
vocab=lexical_doclines$vocab,
K=5,
alpha=0.1,
eta=0.1,
num.iterations= 100)
top.topic.words(lda_result$topics, num.words=5)