This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ldavis_json <- function(m, dtm){ | |
dtm = dtm[slam::row_sums(dtm) > 0, ] | |
# Find required quantities | |
phi <- posterior(m)$terms %>% as.matrix | |
theta <- posterior(m)$topics %>% as.matrix | |
vocab <- colnames(phi) | |
doc.length = slam::row_sums(dtm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, queue | |
from threading import Thread | |
class threadedGenerator(): | |
def function_wrapper(self, q, sentinel, fun, **kwargs): | |
for i in fun(**kwargs): | |
q.put(i) | |
q.put(sentinel) | |
def gen(self, fun, sentinel=None, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set2 = ArticleSet.objects.get(pk=17307) | |
lijst=[] | |
# rij=() # niet nodig | |
for row in reader: | |
aid = int(row[0]) | |
medium = int(row[2]) | |
setid = int(row[1]) | |
# rij=(aid) # dit doet niets | |
if medium is not (4,5,6,7,8,9,11,32): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ElasticSearch Service | |
description "ElasticSearch" | |
start on (net-device-up | |
and local-filesystems | |
and runlevel [2345]) | |
stop on runlevel [016] |