如何解决在Facebook Prophet模型Python上仅绘制预测值
当我通过以下代码使用Facebook先知模型进行绘图时:
number_of_days_in_future = 20
future = m.make_future_dataframe(periods=number_of_days_in_future,freq="D")
weekend = future[future['ds'].dt.dayofweek < 5 ]
prediction = m.predict(weekend)
m.plot(prediction)
plt.title("Prediction of Value")
plt.xlabel("Date")
plt.ylabel("Value")
plt.show()
由于该图的Y轴范围较大,因此很难从图中理解该值。
但是,如果我只预测几天。像这样从Y轴更容易理解值:
我的问题是:
- 有没有办法使它不会跨越这么大的范围? (如果我们可以忽略绘制阴影部分的话)
- 有什么方法可以绘制预测的尾部吗? (我不想绘制整个历史数据)
解决方法
我刚刚从fbprophet存储库中找到了一种满足我要求的方法。
import java.util.Scanner;
public class ternary_operator {
public static void main(String[] args) {
Scanner s = new Scanner(System.in).useDelimiter("\r?\n");
int i = 100;
int j = 200;
String light;
String heavy;
light = (" You are light");
heavy= ("You are heavy");
System.out.println("How much do you weigh? 100 or 200 ?");
s = s.nextInt();
s = i==i?light:heavy;
System.out.println(s);
}
}
,
要忽略阴影部分,请将 'uncertainty' 绘图参数归因于 'False'。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。