Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >用python做时间序列预测十:时间序列实践-航司乘客数预测

用python做时间序列预测十:时间序列实践-航司乘客数预测

作者头像
程序员一一涤生
发布于 2020-06-16 11:37:23
发布于 2020-06-16 11:37:23
4K00
代码可运行
举报
运行总次数:0
代码可运行

本文以航司乘客数预测的例子来组织相关时间序列预测的代码,通过了解本文中的代码,当遇到其它场景的时间序列预测亦可套用。

航司乘客数序列
预测步骤
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
# 加载时间序列数据
_ts = load_data()
# 使用样本熵评估可预测性
print(f'原序列样本熵:{SampEn(_ts.values, m=2, r=0.2 * np.std(_ts.values))}')
# 检验平稳性
use_rolling_statistics(_ts)  # rolling 肉眼
use_df(_ts)  # Dickey-Fuller Test 量化
# 平稳变换
_ts_log, _rs_log_diff = transform_stationary(_ts)
# 使用样本熵评估可预测性
print(f'平稳变换后的序列样本熵:{SampEn(_ts.values, m=2, r=0.2 * np.std(_ts.values))}')
# acf,pacf定阶分析
order_determination(_rs_log_diff)
# plot_lag(_rs)# lag plot(滞后图分析相关性)
# 构建模型
_fittedvalues, _fc, _conf, _title = build_arima(
    _ts_log)  # 这里只传取log后的序列是因为后面会通过指定ARIMA模型的参数d=1来做一阶差分,这样在预测的时候,就不需要手动做逆差分来还原序列,而是由ARIMA模型自动还原
# 预测,并绘制预测结果图
transform_back(_ts, _fittedvalues, _fc, _conf, _title)
预测结果
完整代码
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
# coding='utf-8'
"""
航司乘客数时间序列数据集
该数据集包含了1949-1960年每个月国际航班的乘客总数。
"""
import numpy as np
from matplotlib import rcParams
from statsmodels.tsa.seasonal import seasonal_decompose
from statsmodels.tsa.statespace.sarimax import SARIMAX
from statsmodels.tsa.stattools import acf, pacf

params = {'font.family': 'serif',
          'font.serif': 'FangSong',
          'font.style': 'italic',
          'font.weight': 'normal',  # or 'blod'
          'font.size': 12,  # 此处貌似不能用类似large、small、medium字符串
          'axes.unicode_minus': False
          }
rcParams.update(params)
import matplotlib.pyplot as plt
import pandas as pd
# 未来pandas版本会要求显式注册matplotlib的转换器,所以添加了下面两行代码,否则会报警告
from pandas.plotting import register_matplotlib_converters

register_matplotlib_converters()


def load_data():
    from datetime import datetime
    date_parse = lambda x: datetime.strptime(x, '%Y-%m-%d')
    data = pd.read_csv('datas/samples/AirPassengers.csv',
                       index_col='Month',  # 指定索引列
                       parse_dates=['Month'],  # 将指定列按照日期格式来解析
                       date_parser=date_parse  # 日期格式解析器
                       )
    ts = data['y']
    print(ts.head(10))
    plt.plot(ts)
    plt.show()
    return ts


def use_rolling_statistics(time_series_datas):
    '''
    利用标准差和均值来肉眼观测时间序列数据的平稳情况
    :param time_series_datas:
    :return:
    '''
    roll_mean = time_series_datas.rolling(window=12).mean()
    roll_std = time_series_datas.rolling(window=12).std()
    # roll_variance = time_series_datas.rolling(window=12).var()
    plt.plot(time_series_datas, color='blue', label='Original')
    plt.plot(roll_mean, color='red', label='Rolling Mean')
    plt.plot(roll_std, color='green', label='Rolling Std')
    # plt.plot(roll_variance,color='yellow',label='Rolling Variance')

    plt.legend(loc='best')
    plt.title('利用Rolling Statistics来观测时间序列数据的平稳情况')
    plt.show(block=False)


def use_df(time_series_datas):
    '''
    迪基-富勒单位根检验
    :param time_series_datas:
    :return:
    '''
    from statsmodels.tsa.stattools import adfuller
    dftest = adfuller(time_series_datas, autolag='AIC')
    dfoutput = pd.Series(dftest[0:4], index=['Test Statistic', 'p-value', '#Lags Used', 'Number of Observations Used'])
    for key, value in dftest[4].items():
        dfoutput['Critical Value (%s)' % key] = value
    print(dfoutput)


def use_moving_avg(ts_log):
    moving_avg_month = ts_log.rolling(window=12).mean()
    plt.plot(moving_avg_month, color='green', label='moving_avg')
    plt.legend(loc='best')
    plt.title('利用移动平均法平滑ts_log序列')
    plt.show()
    return moving_avg_month


def use_exponentially_weighted_moving_avg(ts_log):
    expweighted_avg = ts_log.ewm(halflife=12).mean()
    plt.plot(expweighted_avg, color='green', label='expweighted_avg')
    plt.legend(loc='best')
    plt.title('利用指数加权移动平均法平滑ts_log序列')
    plt.show()
    return expweighted_avg


def use_decomposition(ts_log):
    '''
    时间序列分解
    :param ts_log:
    :return: 去除不平稳因素后的序列
    '''
    decomposition = seasonal_decompose(ts_log, freq=12)
    trend = decomposition.trend
    seasonal = decomposition.seasonal
    residual = decomposition.resid

    plt.subplot(411)
    plt.plot(ts_log, label='Original')
    plt.legend(loc='best')
    plt.subplot(412)
    plt.plot(trend, label='Trend')
    plt.legend(loc='best')
    plt.subplot(413)
    plt.plot(seasonal, label='Seasonality')
    plt.legend(loc='best')
    plt.subplot(414)
    plt.plot(residual, label='Residuals')
    plt.legend(loc='best')
    plt.tight_layout()
    plt.show()
    # 衡量趋势强度
    r_var = residual.var()
    tr_var = (trend + residual).var()
    f_t = np.maximum(0, 1.0 - r_var / tr_var)
    print(f_t)
    # 衡量季节性强度
    sr_var = (seasonal + residual).var()
    f_s = np.maximum(0, 1.0 - r_var / sr_var)
    print(f"-------趋势强度:{f_t},季节性强度:{f_s}------")
    return residual


def transform_stationary(ts):
    '''
    平稳变换:
    消除趋势:移动平均、指数加权移动平均
    有时候简单的减掉趋势的方法并不能得到平稳序列,尤其对于高季节性的时间序列来说,此时可以采用differencing(差分)或decomposition(分解)
    消除趋势和季节性:差分、序列分解
    :param ts:
    :return:
    '''
    # 利用log降低异方差性
    ts_log = np.log(ts)
    # plt.plot(ts_log, color='brown', label='ts_log')
    # plt.title('ts_log')
    # plt.show()

    # 移动平均法,得到趋势(需要确定合适的K值,当前例子中,合适的K值是12个月,因为趋势是逐年增长,但是有些复杂场景下,K值的确定很难)
    # trend = use_moving_avg(ts_log)
    # 指数加权移动平均法平,得到趋势(由于每次都是从当前时刻到起始时刻的指数加权平均,所以没有确定K值的问题)
    # trend = use_exponentially_weighted_moving_avg(ts_log)
    # print(trend)
    # 减去趋势:将平滑后的序列从ts_log序列中移除
    # rs = ts_log - trend
    # 若趋势建模是用的移动平均法,由于是取前12个月的均值,所以开始的11个值的移动平均都是非数了,需要去除非数
    # rs.dropna(inplace=True)

    # differencing(差分)
    rs_log_diff = ts_log - ts_log.shift()  # 1阶差分
    # use_rolling_statistics(rs)
    # rs = rs - rs.shift() # 2阶差分
    # 季节性差分 ,此案例中的季节间隔为12个月  d=1 D=1
    # rs = (ts_log - ts_log.shift(periods=12)) - (ts_log.shift() - ts_log.shift().shift(periods=12))
    rs_log_diff.dropna(inplace=True)

    # decomposition(分解)
    # rs = use_decomposition(ts_log)
    # rs.dropna(inplace=True)

    # 对去除趋势后的序列做平稳性检验
    # use_rolling_statistics(rs)
    use_df(rs_log_diff)
    return ts_log, rs_log_diff


def order_determination(ts_log_diff):
    '''
    利用acf和pacf确定模型以及阶数
    :param ts_log_diff:
    :return:
    '''
    lag_acf = acf(ts_log_diff, nlags=10, fft=False)
    lag_pacf = pacf(ts_log_diff, nlags=10, method='ols')
    z = 1.96
    # z = 1.65
    # Plot ACF:
    plt.subplot(121)
    plt.plot(lag_acf)
    plt.axhline(y=0, linestyle='--', color='gray')
    plt.axhline(y=-z / np.sqrt(len(ts_log_diff) - 1), linestyle='--',
                color='gray')  # 利用白噪声的标准正态分布假设来选择相关性的置信度区间,1.9695%置信度下的统计量
    plt.axhline(y=z / np.sqrt(len(ts_log_diff) - 1), linestyle='--', color='gray')
    plt.title('Autocorrelation Function')
    # Plot PACF:
    plt.subplot(122)
    plt.plot(lag_pacf)
    plt.axhline(y=0, linestyle='--', color='gray')
    plt.axhline(y=-z / np.sqrt(len(ts_log_diff)), linestyle='--', color='gray')
    plt.axhline(y=z / np.sqrt(len(ts_log_diff)), linestyle='--', color='gray')
    plt.title('Partial Autocorrelation Function')
    plt.tight_layout()
    plt.show()


def draw_rss_plot(ts_log_diff, orders, title, freq='MS'):
    from statsmodels.tsa.arima_model import ARIMA
    model = ARIMA(ts_log_diff, order=orders, freq=freq)
    results_fitted = model.fit(disp=-1)
    # print(results.summary())
    plt.plot(ts_log_diff)
    plt.plot(results_fitted.fittedvalues, color='red')
    plt.title('%s RSS: %.4f' % (title, sum((results_fitted.fittedvalues - ts_log_diff) ** 2)))
    plt.show()
    return results_fitted.fittedvalues


def draw_future_plot(ts_log_diff, orders, seasonal_order, title, freq='MS'):
    # ARIMA模型
    # model = ARIMA(ts_log_diff, order=orders, freq=freq)
    # results_fitted = model.fit(disp=-1, trend='c')
    # fit_values = results_fitted.fittedvalues
    # fc, _, conf = results_fitted.forecast(36, alpha=0.05)  # 95% conf

    # 季节性ARIMA模型
    model = SARIMAX(ts_log_diff, order=orders, seasonal_order=seasonal_order)
    results_fitted = model.fit(disp=5)
    fit_values = results_fitted.fittedvalues
    print(results_fitted.summary())
    fc = results_fitted.forecast(36)
    conf = None

    return fit_values, fc, conf, title


def build_arima(ts_log_diff):
    '''
    start_params表示ARIMA模型的所有项的参数,包括常数项,AR阶数项,MA阶数项,随机误差项.
    '''
    # order = (0, 1, 0) # 仅能靠常数的逆差分构建一个趋势,这里的常数是start_params的第一个元素,是通过一个全一的exog列向量和一个endog列向量做OLS方法得到的一个常数,这个常数其实就是endog向量元素的平均值
    # order = (3, 1, 0) # 逆差分构建一个趋势 + 变量自回归拟合一定的波动
    # order = (0, 1, 3) # 逆差分构建一个趋势 + 随机误差自回归拟合一定的波动,误差应该是来自平均值作为预测的误差,待求证
    order = (3, 0, 2)  # 变量自回归拟合一定的波动 + 预测误差自回归拟合一定的波动
    seasonal_order = (0, 1, 0, 12)  # 季节性差分,季节窗口=12个月

    # draw_rss_plot(ts_log_diff, order, '拟合:%s' % str(order))

    fittedvalues, fc, conf, title = draw_future_plot(ts_log_diff, order, seasonal_order,
                                                     '预测:%s,%s' % (str(order), str(seasonal_order)))
    return fittedvalues, fc, conf, title


def transform_back(ts, fittedvalues, fc, conf, title):
    '''
    变换回平稳变换之前的状态,以便预测目标观测值
    :param ts: 原始序列
    :param fittedvalues: 拟合出的序列
    :param fc: 预测的未来序列
    :return:
    '''
    # Make as pandas series
    future_index = pd.date_range(start=ts.index[-1], freq='MS', periods=36)
    fc_series = pd.Series(fc, index=future_index)
    print(fc_series.head())
    print(fittedvalues.head(24))
    lower_series, upper_series = None, None
    if conf is not None:
        lower_series = pd.Series(conf[:, 0], index=future_index)
        upper_series = pd.Series(conf[:, 1], index=future_index)

    current_ARIMA_log = pd.Series(fittedvalues, copy=True)
    future_ARIMA_log = pd.Series(fc_series, copy=True)

    # 逆log
    current_ARIMA = np.exp(current_ARIMA_log)
    future_ARIMA = np.exp(future_ARIMA_log)
    # lower_ARIMA = np.exp(lower_log_series)
    # upper_ARIMA = np.exp(upper_log_series)
    # Plot
    plt.figure(figsize=(12, 5), dpi=100)
    plt.plot(ts, label='current_actual')
    plt.plot(current_ARIMA, label='current_fit')
    plt.plot(future_ARIMA, label='forecast', marker='o', ms=3)
    if lower_series is not None:
        # plt.fill_between(lower_ARIMA.index, lower_ARIMA, upper_ARIMA,color='k', alpha=.15)
        pass
    plt.title('Forecast vs Actuals %s' % title)
    plt.legend(loc='upper left', fontsize=8)
    plt.show()


def plot_lag(rs):
    from pandas.plotting import lag_plot
    fig, axes = plt.subplots(1, 4, figsize=(10, 3), sharex=True, sharey=True, dpi=100)
    for i, ax in enumerate(axes.flatten()[:4]):
        lag_plot(rs, lag=i + 1, ax=ax, c='firebrick')
        ax.set_title('Lag ' + str(i + 1))

    fig.suptitle('Lag Plots of AirPassengers', y=1.15)
    plt.show()
    
def SampEn(U, m, r):
    """
    Compute Sample entropy
    用于量化时间序列的可预测性
    思想:
    返回一个-np.log(A/B),该值越小预测难度越小,所以A/B越大,预测难度越小。
    :param U: 时间序列
    :param m: 模板向量维数
    :param r: 距离容忍度,一般取0.1~0.25倍的时间序列标准差,也可以理解为相似度的度量阈值,小于这个阈值的2个向量被认为是相似的
    :return: 返回一个-np.log(A/B),该值越小预测难度越小,所以A/B越大,预测难度越小。 一般可以和同等长度的随机序列的结果比较,小于这个结果,则具备一定的可预测性
    """

    def _maxdist(x_i, x_j):
        """
         Chebyshev distance
        :param x_i:
        :param x_j:
        :return:
        """
        return max([abs(ua - va) for ua, va in zip(x_i, x_j)])

    def _phi(m):
        x = [[U[j] for j in range(i, i + m - 1 + 1)] for i in range(N - m + 1)]
        C = [len([1 for j in range(len(x)) if i != j and _maxdist(x[i], x[j]) <= r]) for i in range(len(x))]
        return sum(C)

    N = len(U)
    return -np.log(_phi(m + 1) / _phi(m))


if __name__ == '__main__':
    # 加载时间序列数据
    _ts = load_data()
    # 使用样本熵评估可预测性
    print(f'原序列样本熵:{SampEn(_ts.values, m=2, r=0.2 * np.std(_ts.values))}')
    # 检验平稳性
    use_rolling_statistics(_ts)  # rolling 肉眼
    use_df(_ts)  # Dickey-Fuller Test 量化
    # 平稳变换
    _ts_log, _rs_log_diff = transform_stationary(_ts)
    # 使用样本熵评估可预测性
    print(f'平稳变换后的序列样本熵:{SampEn(_ts.values, m=2, r=0.2 * np.std(_ts.values))}')
    # acf,pacf定阶分析
    order_determination(_rs_log_diff)
    # plot_lag(_rs)# lag plot(滞后图分析相关性)
    # 构建模型
    _fittedvalues, _fc, _conf, _title = build_arima(
        _ts_log)  # 这里只传取log后的序列是因为后面会通过指定ARIMA模型的参数d=1来做一阶差分,这样在预测的时候,就不需要手动做逆差分来还原序列,而是由ARIMA模型自动还原
    # 预测,并绘制预测结果图
    transform_back(_ts, _fittedvalues, _fc, _conf, _title)
小结

陆陆续续写了10篇时间序列相关的文章了,本系列主要是应用为主,包括初识概念、时间序列数据可视化、时间序列分解、平稳/非平稳时间序列、时间序列缺失值处理、相关函数图/偏相关函数图/滞后图、时间序列复杂度量化、Granger causality test(格兰杰因果检验)、ARIMA模型简介、时间序列实践-航司乘客数预测。 暂时先记录到这里,后续应该还会补充一些,比如基于深度学习的时间序列预测等。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020-06-16 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
时间序列预测全攻略(附带Python代码)
原文作者:AARSHAY JAIN 36大数据翻译,http://www.36dsj.com/archives/43811 时间序列(简称TS)被认为是分析领域比较少人知道的技能。(我也是几天前才知道它)。但是你一定知道最近的小型编程马拉松就是基于时间序列发展起来的,我参加了这项活动去学习了解决时间序列问题的基本步骤,在这儿我要分享给大家。这绝对能帮助你在编程马拉松中获得一个合适的模型。 文章之前,我极力推荐大家阅读《基于R语言的时间序列建模完整教程》A Complete Tutorial on Ti
机器学习AI算法工程
2018/03/13
15K0
时间序列预测全攻略(附带Python代码)
最完整的时间序列分析和预测(含实例及代码)
在生产和科学研究中,对某一个或者一组变量 进行观察测量,将在一系列时刻所得到的离散数字组成的序列集合,称之为时间序列。
润森
2022/09/22
4.2K0
最完整的时间序列分析和预测(含实例及代码)
用python做时间序列预测九:ARIMA模型简介
c是常数项,εt是随机误差项。 对于一个AR(1)模型而言: 当 ϕ1=0 时,yt 相当于白噪声; 当 ϕ1=1 并且 c=0 时,yt 相当于随机游走模型; 当 ϕ1=1 并且 c≠0 时,yt 相当于带漂移的随机游走模型; 当 ϕ1<0 时,yt 倾向于在正负值之间上下浮动。
程序员一一涤生
2020/06/17
31.9K1
Python中的ARIMA模型、SARIMA模型和SARIMAX模型对时间序列预测|附代码数据
根据频率,时间序列可以是每年(例如:年度预算),每季度(例如:支出),每周(例如:销售数量),每天(例如天气),每小时(例如:股票价格),分钟(例如:来电提示中的呼入电话),甚至是几秒钟(例如:网络流量)。
拓端
2023/07/17
9570
Python中的ARIMA模型、SARIMA模型和SARIMAX模型对时间序列预测|附代码数据
根据频率,时间序列可以是每年(例如:年度预算),每季度(例如:支出),每周(例如:销售数量),每天(例如天气),每小时(例如:股票价格),分钟(例如:来电提示中的呼入电话),甚至是几秒钟(例如:网络流量)。
拓端
2023/02/20
1.9K0
用ARIMA模型做需求预测
---- 本文结构: 时间序列分析? 什么是ARIMA? ARIMA数学模型? input,output 是什么? 怎么用?-代码实例 常见问题? ---- 时间序列分析? 时间序列,就是按时间顺序排列的,随时间变化的数据序列。 生活中各领域各行业太多时间序列的数据了,销售额,顾客数,访问量,股价,油价,GDP,气温。。。 随机过程的特征有均值、方差、协方差等。 如果随机过程的特征随着时间变化,则此过程是非平稳的;相反,如果随机过程的特征不随时间而变化,就称此过程是平稳的。 下图所示,左边非稳定,右边
杨熹
2018/04/02
3.1K0
用ARIMA模型做需求预测
最全总结【时间序列】时间序列的预处理和特征工程
时间序列(Time Series)是按时间顺序排列的一组数据点,通常用于描述和分析随时间变化的现象。时间序列数据在许多领域中都有广泛应用,如金融市场、气象学、经济学、医学等。
机器学习司猫白
2025/01/21
6260
最全总结【时间序列】时间序列的预处理和特征工程
Python中的ARIMA模型、SARIMA模型和SARIMAX模型对时间序列预测|附代码数据
使用ARIMA模型,您可以使用序列过去的值预测时间序列(点击文末“阅读原文”获取完整代码数据)。
拓端
2022/11/07
2K0
时间序列模型(ARIMA和ARMA)完整步骤详述「建议收藏」
我于2019年发布此篇文章至今收获了许多人的指点,当时的代码的确晦涩难懂,近期有空,将代码重新整理了一遍,重新发送至此。希望能够帮助大家更好地理解。
全栈程序员站长
2022/08/25
7.4K0
时间序列模型(ARIMA和ARMA)完整步骤详述「建议收藏」
Python中的ARIMA模型、SARIMA模型和SARIMAX模型对时间序列预测
使用ARIMA模型,您可以使用序列过去的值预测时间序列。在本文中,我们从头开始构建了一个最佳ARIMA模型,并将其扩展到Seasonal ARIMA(SARIMA)和SARIMAX模型。
拓端
2020/08/07
9K0
python时间序列分析代码_时间序列分析VAR实验报告
题记:毕业一年多天天coding,好久没写paper了。在这动荡的日子里,也希望写点东西让自己静一静。恰好前段时间用python做了一点时间序列方面的东西,有一丁点心得体会想和大家分享下。在此也要特别感谢顾志耐和散沙,让我喜欢上了python。
全栈程序员站长
2022/09/19
1.1K0
python时间序列分析代码_时间序列分析VAR实验报告
干货 | 20个教程,掌握时间序列的特征分析(附代码)
【导语】时间序列是指以固定时间为间隔的序列值。本篇教程将教大家用 Python 对时间序列进行特征分析。
AI科技大本营
2019/07/11
6.1K0
干货 | 20个教程,掌握时间序列的特征分析(附代码)
基于趋势和季节性的时间序列预测
时间序列预测是基于时间数据进行预测的任务。它包括建立模型来进行观测,并在诸如天气、工程、经济、金融或商业预测等应用中推动未来的决策。
deephub
2022/11/11
1.2K0
基于趋势和季节性的时间序列预测
Python时间序列分析--ARIMA模型实战案例
本文将介绍使用Python来完成时间序列分析ARIMA模型的完整步骤与流程,绘制时序图,平稳性检验,单位根检验,白噪声检验,模型定阶,模型有啊,参数估计,模型检验等完整步骤。Python建立时间序列分析–ARIMA模型实战案例
润森
2022/08/18
1.8K0
Python时间序列分析--ARIMA模型实战案例
一文囊括时间序列方法(源码)
时间序列是指将某种现象某一个统计指标在不同时间上的各个数值,按时间先后顺序排列而形成的序列。典型的时间序列问题,例如股价预测、制造业中的电力预测、传统消费品行业的销售预测、客户日活跃量预测等等。(本文以客户日活跃量预测为例。)
算法进阶
2022/06/01
8300
一文囊括时间序列方法(源码)
通过 Python 代码实现时间序列数据的统计学预测模型
Autoregressive Integrated Moving Average model (ARIMA),差分整合移动平均自回归模型。ARIMA(p,d,q)主要包含三项:
deephub
2020/05/09
2.1K0
通过 Python 代码实现时间序列数据的统计学预测模型
用Python进行时间序列分解和预测
本文介绍了用Python进行时间序列分解的不同方法,以及如何在Python中进行时间序列预测的一些基本方法和示例。
Datawhale
2021/01/07
3.8K0
用Python进行时间序列分解和预测
Pandas数据应用:时间序列预测
时间序列预测是数据分析领域中一个非常重要的课题,它涉及到对未来某一时刻的数据进行预测。Pandas 是 Python 中用于数据处理和分析的强大库,提供了许多便捷的函数来处理时间序列数据。本文将由浅入深地介绍如何使用 Pandas 进行时间序列预测,常见问题及报错,并提供解决方案。
Jimaks
2025/01/12
3450
时间序列预测模型-ARIMA原理及Python实现!
再介绍本篇的内容之前,我们先来看一下本文用到的数据。本文用到的中国银行股票数据下载:http://pan.baidu.com/s/1gfxRFbH。
石晓文
2018/12/06
14.7K1
Pandas 高级教程——高级时间序列分析
Pandas 提供了强大的时间序列处理功能,使得对时间序列数据进行高级分析变得更加灵活和方便。在本篇博客中,我们将深入介绍 Pandas 中的高级时间序列分析技术,并通过实例演示如何应用这些功能。
Echo_Wish
2023/12/29
3960
推荐阅读
相关推荐
时间序列预测全攻略(附带Python代码)
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验