python时间序列库_Anticipy - 用于时间序列预测的Python库

68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f616e7469636970792e73766768747470733a2f2f7472617669732d63692e636f6d2f736b792d756b2f616e7469636970792e7376673f6272616e63683d6d617374657268747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f616e7469636970792f62616467652f3f76657273696f6e3d6c617465737468747470733a2f2f636f6465636f762e696f2f6769746875622f736b792d756b2f616e7469636970792f6272616e63682f6d61737465722f67726170682f62616467652e73766768747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f736b79756b2f616e7469636970792e737667

Anticipy

Anticipy is a tool to generate forecasts for time series. It takes a pandas Series or DataFrame as input, and returns a DataFrame with the forecasted values for a given period of time.

Features:

Simple interface. Start forecasting with a single function call on a pandas DataFrame.

Model selection. If you provide different multiple models (e.g. linear, sigmoidal, exponential), the tool will compare them and choose the best fit for your data.

Trend and seasonality. Support for weekly and monthly seasonality, among other types.

Calendar events. Provide lists of special dates, such as holiday seasons or bank holidays, to improve model performance.

Data cleaning. The library has tools to identify and remove outliers, and to detect and handle step changes in the data.

It is straightforward to generate a simple linear model with the tool - just call forecast.run_forecast(my_dataframe):

import pandas as pd, numpy as np

from anticipy import forecast

df = pd.DataFrame({'y': np.arange(0., 5)}, index=pd.date_range('2018-01-01', periods=5, freq='D'))

df_forecast = forecast.run_forecast(df, extrapolate_years=1)

print(df_forecast.head(12))

Output:

. date model y is_actuals

0 2018-01-01 y 0.000000e+00 True

1 2018-01-02 y 1.000000e+00 True

2 2018-01-03 y 2.000000e+00 True

3 2018-01-04 y 3.000000e+00 True

4 2018-01-05 y 4.000000e+00 True

5 2018-01-01 linear 5.551115e-17 False

6 2018-01-02 linear 1.000000e+00 False

7 2018-01-03 linear 2.000000e+00 False

8 2018-01-04 linear 3.000000e+00 False

9 2018-01-05 linear 4.000000e+00 False

10 2018-01-06 linear 5.000000e+00 False

11 2018-01-07 linear 6.000000e+00 False

Documentation is available in Read the Docs

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值