首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >yellowbrick visualiser.fit()引发ValueError

yellowbrick visualiser.fit()引发ValueError
EN

Stack Overflow用户
提问于 2019-03-10 22:46:18
回答 1查看 119关注 0票数 2

我试着让你为我的推特数据可视化一个分散度图

以下是指向数据集的链接

dataset

这是代码

代码语言:javascript
复制
from yellowbrick.text import DispersionPlot

text = combine['tweet']
target_words = ht_negative_unnest

visualizer = DispersionPlot(target_words)
visualizer.fit(text)
visualizer.poof()

我尝试在上面存储在ht_negative_unnest中的代码中传递一个类似这样的列表

代码语言:javascript
复制
 ['cnn',
     'michigan',
     'tcot',
     'australia',
     'opkillingbay']

引发的错误

代码语言:javascript
复制
 YellowbrickValueError                     Traceback (most recent call last)
<ipython-input-114-d6a94f150164> in <module>
      7 # Create the visualizer and draw the plot
      8 visualizer = DispersionPlot(target_words)
----> 9 visualizer.fit(text)
     10 visualizer.poof()

c:\users\hp\appdata\local\programs\python\python37\lib\site-packages\yellowbrick\text\dispersion.py in fit(self, X, y, **kwargs)
    171         self.target = points_target[:,2]
    172 
--> 173         self._check_missing_words(points)
    174 
    175         self.draw(points, self.target)

c:\users\hp\appdata\local\programs\python\python37\lib\site-packages\yellowbrick\text\dispersion.py in _check_missing_words(self, points)
    119                     "The indexed word '{}' is not found in "
    120                     "this corpus"
--> 121                     ).format(self.indexed_words_[index]))
    122 
    123     def fit(self, X, y=None, **kwargs):

YellowbrickValueError: The indexed word 'wso' is not found in this corpus
EN

回答 1

Stack Overflow用户

发布于 2019-03-23 00:21:51

我认为在你的语料库中找不到wso;只有#wso

你有没有试过像“爱”这样的单一目标词?你还能看到这个错误吗?

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55088854

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档