我想知道gensim的LDA (Latent Dirichlet Allocation)算法中默认迭代次数。我认为文档中没有提到这一点。(迭代次数由参数iterations在初始化LdaModel时表示)。谢谢!
我想知道gensim的LDA (Latent Dirichlet Allocation)算法中默认迭代次数。我认为文档中没有提到这一点。(迭代次数由参数iterations在初始化LdaModel时表示)。谢谢!
检查位于 python/Lib/site-packages 目录中的模块文件。构造函数大致如下 -
def __init__(self, corpus=None, num_topics=100, id2word=None,
distributed=False, chunksize=2000, passes=1, update_every=1,
alpha='symmetric', eta=None, decay=0.5, offset=1.0,
eval_every=10, iterations=50, gamma_threshold=0.001)
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s',
level=logging.INFO)
running batch LDA training, 17 topics, 10 passes over the supplied corpus of 1130 documents, updating model once every 1130 documents, evaluating perplexity every 1130 documents, iterating 50x with a convergence threshold of 0.001000
默认迭代次数为50