我想用Yellowbrick可视化工具绘制预测误差图,但我没有得到想要的结果。该图类似于pp图或qq图,这是不正确的。此外,我不能改变轴的标签和添加标题,我也不能得到任何默认标签和图例。有人能告诉我我该怎么做吗?这是可视化工具的代码:
def predict_error(model):
visualizer = PredictionError(model)
visualizer.fit(X_train, Y_train) # Fit the training data to the visualizer
visualizer.score(X_test, Y_test) # Evaluate the model on the test data
visualizer.show() 这是我得到的输出:

发布于 2020-06-10 02:50:38
我们最近有一个贡献者在我们的ResidualsPlot中添加了QQ图功能,虽然提交还没有完全部署,但在那之前,你可以使用these instructions派生和克隆黄砖,然后创建QQ图,如下所示:
from sklearn.linear_model import Ridge
from sklearn.model_selection import train_test_split as tts
from yellowbrick.datasets import load_concrete
from yellowbrick.regressor import ResidualsPlot
# Load a regression dataset
X, y = load_concrete()
# Create the train and test data
X_train, X_test, y_train, y_test = tts(
X, y, test_size=0.2, random_state=37
)
# Instantiate the visualizer,
# setting the `hist` param to False and the `qqplot` parameter to True
visualizer = ResidualsPlot(
Ridge(),
hist=False,
qqplot=True,
train_color="gold",
test_color="maroon"
)
visualizer.fit(X_train, y_train)
visualizer.score(X_test, y_test)
visualizer.show()结果如下:

https://stackoverflow.com/questions/62178352
复制相似问题