【发布时间】:2020-03-07 04:14:00
【问题描述】:
我最近在 iris 数据集上实现了概率神经网络。我试图使用 YellowBrick 分类器打印分类报告,但是当我运行此代码时出现错误。如下。
from neupy import algorithms
model = algorithms.PNN(std=0.1, verbose=True, batch_size = 500)
model.train(X_train, Y_train)
predictions = model.predict(X_test)
from yellowbrick.classifier import ClassificationReport
visualizer = ClassificationReport(model, support=True)
visualizer.fit(X_train, Y_train) # Fit the visualizer and the model
visualizer.score(X_test, Y_test) # Evaluate the model on the test data
visualizer.show()
此代码返回此错误。
YellowbrickTypeError: This estimator is not a classifier; try a regression or clustering score visualizer instead!
当我为其他分类模型尝试相同的分类报告代码时,它可以工作。我不知道。为什么会这样?谁能帮我解决这个问题?
【问题讨论】:
-
请显示你的
model到底是什么。 -
嗨@desertnaut ..我已经添加了它。很抱歉没有早点添加它
标签: python machine-learning neural-network yellowbrick