Gensim LDA - 默认迭代次数
Gensim LDA - Default number of iterations
我想知道 gensim 的 LDA(潜在狄利克雷分配)算法中的默认迭代次数。我认为文档没有谈到这一点。 (在初始化 LdaModel 时,迭代次数由参数 iterations 表示)。谢谢!
检查了 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)
因此,默认迭代次数为 50。
如果您使用:
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
我想知道 gensim 的 LDA(潜在狄利克雷分配)算法中的默认迭代次数。我认为文档没有谈到这一点。 (在初始化 LdaModel 时,迭代次数由参数 iterations 表示)。谢谢!
检查了 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)
因此,默认迭代次数为 50。
如果您使用:
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