使用 LDA 进行主题建模查找剪影分数

问题描述

我需要为 LDA 模型找到 silhouette_score()。我不知道应用它。

count = CountVectorizer(stop_words='english',max_df=.1,max_features=5000) X = count.fit_transform(df['Tweet'].values) lda = LatentDirichletAllocation(n_components=5,随机状态=123, learning_method='batch') X_topics = lda.fit_transform(X) 剪影 = 剪影_得分(X,X_topics)

Silhoutte 返回错误:ValueError: y 应该是一个一维数组,而是得到一个形状为 (7767,5) 的数组。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)