TypeError: __init__() got an unexpected keyword argument 'n_components'
TypeError: __init__() got an unexpected keyword argument 'n_components'
我正在尝试对数据集应用 LatentDirichletAllocation
。当我尝试为 LDA 的 n_component
参数赋值时。我收到以下错误。
TypeError Traceback (most recent call last)
<ipython-input-25-6f5cf163fcaf> in <module>()
23 # tfidf = vectorizer.fit_transform(line)
24 # print(tfidf)
---> 25 lda = LatentDirichletAllocation(n_components = 100)
26 lda.fit(bag_of_words)
27 tf_feature_names = vector.get_feature_names()
TypeError: __init__() got an unexpected keyword argument 'n_components'
如果您使用的是旧版本的 sklearn (< 0.19),您应该使用 n_topics
arg 代替 n_components
lda = LatentDirichletAllocation(n_topics=100)
中找到
我正在尝试对数据集应用 LatentDirichletAllocation
。当我尝试为 LDA 的 n_component
参数赋值时。我收到以下错误。
TypeError Traceback (most recent call last)
<ipython-input-25-6f5cf163fcaf> in <module>()
23 # tfidf = vectorizer.fit_transform(line)
24 # print(tfidf)
---> 25 lda = LatentDirichletAllocation(n_components = 100)
26 lda.fit(bag_of_words)
27 tf_feature_names = vector.get_feature_names()
TypeError: __init__() got an unexpected keyword argument 'n_components'
如果您使用的是旧版本的 sklearn (< 0.19),您应该使用 n_topics
arg 代替 n_components
lda = LatentDirichletAllocation(n_topics=100)
中找到