【发布时间】:2018-08-03 15:28:16
【问题描述】:
我正在尝试使用 Yellowbrick 包中的 t-SNE 可视化数据。我遇到了一个错误。
import pandas as pd
from yellowbrick.text import TSNEVisualizer
from sklearn.datasets import make_classification
## produce random data
X, y = make_classification(n_samples=200, n_features=100,
n_informative=20, n_redundant=10,
n_classes=3, random_state=42)
## visualize data with t-SNE
tsne = TSNEVisualizer()
tsne.fit(X, y)
tsne.poof()
错误(由 fit 方法引发):
ValueError: The truth value of an array with more than one element
is ambiguous. Use a.any() or a.all()
【问题讨论】:
-
抱歉,这是自 numpy 1.13 发布以来出现的问题,将在 Yellowbrick 的 0.6 版本中修复。我已经为它打开了一个问题here。
标签: python visualization yellowbrick