2014-01-09 2 views
1

작동하지 lda.collapsed.gibbs.sampler 나는 R에 완전히 새로운 그리고 난 현재 로그를 분석 할 TMLDA와 패키지를 일하고 있어요.초기 R

lda.collapsed.gibbs.sampler는 "초기"매개 변수를 사용 할 수 있으며, 문서에 명시된 년대 :

initial

A list of initial topic assignments for words. It should be in the same format as the assignments field of the return value. If this field is NULL, then the sampler will be initialized with random assignments.

을하지만 난에 매개 변수로 이전 결과 $ 지정을 통과 반복 할 때 처음에 오류가 발생합니다 :

> result <- lda.collapsed.gibbs.sampler(data, K,vocab,i, 0.1,0.1, initial = lda_result$assignments, compute.log.likelihood=TRUE) 
Error in structure(.Call("collapsedGibbsSampler", documents, as.integer(K), : 
STRING_ELT() can only be applied to a 'character vector', not a 'NULL' 

나는 이것을 없애고 실제로 목록을 사용하는 법을 모르겠습니다. 내가 원하는 것은 단계를 밟아서 결과를 보는 것으로 수렴성 측정을하는 것인데, 따라서 단순히 을 더 큰 숫자로 입력하면 작동하지 않습니다.

미리 감사드립니다. :)

답변

1

문서는 약간 여백이 있습니다. initial=list(assignments = lda_result$assignments)을 설정해야합니다. 더 일반적으로 initialassignments 또는 모두 topicstopic_sums 중 하나를 설정해야하는 목록입니다.

+0

감사합니다. 이제 작동 :) 문서가 명확하게 명확하지 않습니다. –