简体   繁体   English

我的实际和预测的原始数据集有超过 5000 多个值我只想 plot 150 个值

[英]My orginal data set of actual and predicted has over 5000+ values i want to only plot 150 values

I tried the below code but it didn't work what else should i try我尝试了下面的代码,但它没有用我还应该尝试什么

 fig=plt.figure()
    plt.plot(ypredicted[0:150],color="red",linewidth=2.5,linestyle="-")
    plt.plot(actual[0:150],color="blue",linewidth=2.5)

在此处输入图像描述

It looks like this because it is a line chart and all of those points are connected.它看起来像这样,因为它是一个折线图,并且所有这些点都连接在一起。 I'm assuming you want a scatter plot showing the predicted on x-axis and actual on y-axis.我假设您想要一个散点图 plot 显示 x 轴上的预测值和 y 轴上的实际值。 If they have a positive relationship, then you know that the model is more or less predicting okay.如果它们具有正相关关系,那么您知道 model 或多或少可以预测。

Try replacing your plt.plot lines with尝试将您的 plt.plot 线替换为

plt.scatter(ypredicted[0:150], actual[0:150]) plt.scatter(ypredicted[0:150], 实际[0:150])

plt.show() plt.show()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何 plot 神经网络的实际值与预测值? - How I can plot the actual vs predicted values for the neural network? 使用 seaborn 绘制实际值与预测值的散点图 - Plot scatter with actual vs predicted values with seaborn 当我们有多索引时如何用实际值绘制预测值 - How to plot predicted values with actual values when we have multi-index 如何仅绘制所需的值? - How do I only plot the values I want? 如何从 Python 中的 CSV 文件中提供 5000+ 个符号流数据请求? - How do I give 5000+ symbols streaming data request from CSV file in Python? Neurolab-测试集的预测值 - Neurolab - predicted values for test set 在 Keras 中显示 'y' 的预测值和相应的实际 'x' 值 - Displaying predicted values of 'y' with corresponding actual 'x' values in Keras 为什么我的条形 plot 没有按降序排列,而我的数据已使用 sort_values 按降序排列? (与熊猫) - Why my bar plot isn't in descending order while my data has been set in descending order with sort_values ? (with pandas) 如何 plot 预测值与真实值? - How to plot predicted values vs the true value? 预测值的数据集索引与实际值的索引不匹配 - Dataset indices for predicted values is not matching with those for actual values
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM