[英]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.