def make_future_dataframe(self, periods, freq=’D’, include_history=True):
“””Simulate the trend using the extrapolated generative model.
Parameters
pd.Dataframe that extends forward from the end of self.history for the
requested number of periods.
“””
make_future_dataframe()参数说明:
- periods: 向前预测步数
- freq: 预测单位小时为’H’,天为’D’,月为’M’
- include_history: 是否包含历史数据的预测
=====================================================================
make_future_dataframe()准备预测的数据框架,该函数的定义如下:
periods:指定要预测的时长,要根据freq这个参数去设置。假如freq=’D’,那么粒度为天,periods则指定要预测未来多少天的数据。如果freq=’H’,则periods指定要预测未来多少小时的数据(当然,要在框架支持粒度为小时的前提下才能运用)。
include_history:是否包含历史数据,保持默认就好。
=========================================================================
若有以下时间序列,如何在每月月末显示该月数据的均值?
>>> 
import
pandas as pd
>>> 
import
numpy as np
>>> ts 
=
pd.Series(np.random.randint(
0
,
10
,
10
))
>>> ts.index 
=
pd.date_range(start
=
'2020-1-15'
,periods
=
10
,freq
=
'10D'
)
>>> ts
2020
-
01
-
15
7
2020
-
01
-
25
1
2020
-
02
-
04
8
2020
-
02
-
14
7
2020
-
02
-
24
1
2020
-
03
-
05
3
2020
-
03
-
15
6
2020
-
03
-
25
8
2020
-
04
-
04
6
2020
-
04
-
14
1
Freq: 
10D
, dtype: int32
====================================================================
pd.date_range(start=’2022-08-14 08:01:00′, periods=24,freq=’5T’)
DatetimeIndex([‘2022-08-14 08:01:00’, ‘2022-08-14 08:06:00’,
‘2022-08-14 08:11:00’, ‘2022-08-14 08:16:00’,
‘2022-08-14 08:21:00’, ‘2022-08-14 08:26:00’,
‘2022-08-14 08:31:00’, ‘2022-08-14 08:36:00’,
‘2022-08-14 08:41:00’, ‘2022-08-14 08:46:00’,
‘2022-08-14 08:51:00’, ‘2022-08-14 08:56:00’,
‘2022-08-14 09:01:00’, ‘2022-08-14 09:06:00’,
‘2022-08-14 09:11:00’, ‘2022-08-14 09:16:00’,
‘2022-08-14 09:21:00’, ‘2022-08-14 09:26:00’,
‘2022-08-14 09:31:00’, ‘2022-08-14 09:36:00’,
‘2022-08-14 09:41:00’, ‘2022-08-14 09:46:00’,
‘2022-08-14 09:51:00’, ‘2022-08-14 09:56:00′],
dtype=’datetime64[ns]’, freq=’5T’)Original: https://blog.csdn.net/lizz2276/article/details/126331642
Author: lizz2276
Title: prophet make_future_dataframe()参数说明
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/640076/
转载文章受原作者版权保护。转载请注明原作者出处!