Time series forecasting predicts future values by learning patterns from past data. It is widely used in sales, finance, energy, web traffic, inventory planning, and business decision-making. But a lot has changed since the advent of advance ML models. 时间序列预测通过从历史数据中学习模式来预测未来值。它广泛应用于销售、金融、能源、网络流量、库存规划和商业决策等领域。但随着先进机器学习模型的出现,情况已经发生了很大变化。
Forecasting has moved from traditional statistical models to neural and foundation-model approaches. Tools like Prophet, NeuralProphet, TimeGPT, and Chronos reflect this shift, each balancing accuracy, scalability, explainability, and production needs differently. In this article, we will compare these tools and understand where each one fits best in the time forecasting spectrum. 预测已经从传统的统计模型发展到神经网络和基础模型方法。Prophet、NeuralProphet、TimeGPT 和 Chronos 等工具反映了这一转变,它们在准确性、可扩展性、可解释性和生产需求之间各有不同的平衡。在本文中,我们将比较这些工具,并了解每一种在时间预测频谱中最适合的位置。
Choosing a forecasting tool is not only about finding the most accurate model. In real projects, teams also need to think about explainability, scalability, speed, cost, and deployment needs. Some forecasts must be simple enough for business users to understand, while others must handle thousands of time series quickly. Prophet, NeuralProphet, TimeGPT, and Chronos solve different forecasting problems. Prophet focuses on clarity and interpretability, NeuralProphet adds lag-based learning, TimeGPT reduces setup through an API, and Chronos supports open-weight foundation-model forecasting. 选择预测工具不仅仅是找到最准确的模型。在实际项目中,团队还需要考虑可解释性、可扩展性、速度、成本和部署需求。有些预测必须足够简单,以便业务用户理解;而另一些则需要快速处理数千个时间序列。Prophet、NeuralProphet、TimeGPT 和 Chronos 解决不同的预测问题。Prophet 侧重于清晰性和可解释性,NeuralProphet 增加了基于滞后的学习,TimeGPT 通过 API 减少设置工作,Chronos 则支持开源权重的基础模型预测。
Before testing the forecasting tools, the required libraries must be installed. Prophet and NeuralProphet are used for local model training, TimeGPT needs the Nixtla SDK and an API key, and Chronos can be used through the Chronos forecasting package or AutoGluon. 在测试预测工具之前,必须安装所需的库。Prophet 和 NeuralProphet 用于本地模型训练,TimeGPT 需要 Nixtla SDK 和 API 密钥,Chronos 可以通过 Chronos 预测包或 AutoGluon 使用。
# These are the libraries required for using all of the tools covered in this article
pip install prophet
pip install neuralprophet
pip install nixtla
pip install chronos-forecasting
pip install autogluon.timeseries
These commands install the main packages required to run for Prophet, NeuralProphet, TimeGPT, and Chronos. 这些命令安装了运行 Prophet、NeuralProphet、TimeGPT 和 Chronos 所需的主要包。
Prophet is a simple, explainable, open-source forecasting tool developed by Facebook. It works well for business data with trends, seasonality, holidays, and recurring events, making it useful for sales, demand, and web traffic forecasting.Prophet 是 Facebook 开发的一个简单、可解释的开源预测工具。它适用于具有趋势、季节性、节假日和周期性事件的业务数据,可用于销售、需求和网络流量预测。
Prophet requires two columns: ds for the date or timestamp and y for the target value. Once trained, it can generate future forecasts with uncertainty intervals, making it a strong baseline before trying NeuralProphet, TimeGPT, or Chronos.Prophet 需要两列:ds 用于日期或时间戳,y 用于目标值。训练完成后,它可以生成带有不确定性区间的未来预测,使其成为尝试 NeuralProphet、TimeGPT 或 Chronos 之前的强有力基线。

import pandas as pd
from prophet import Prophet
df = pd.DataFrame({
"ds": pd.date_range("2024-01-01", periods=200, freq="D"),
"y": range(200),
})
model = Prophet()
model.fit(df)
future = model.make_future_dataframe(periods=30)
forecast = model.predict(future)
print(forecast[["ds", "yhat", "yhat_lower", "yhat_upper"]].tail())

This code creates a simple daily time series dataset using Pandas. The ds column contains dates, and the y column contains the values to forecast. The Prophet model is then initialized and trained using the historical data. After training, make_future_dataframe() creates dates for the next 30 days. The predict() function generates the forecast. The output includes that, which is the predicted value, along with yhat_lower and yhat_upper, which show the uncertainty range. 这段代码使用 Pandas 创建了一个简单的每日时间序列数据集。ds 列包含日期,y 列包含要预测的值。然后初始化 Prophet 模型并使用历史数据进行训练。训练完成后,make_future_dataframe() 创建未来 30 天的日期。predict() 函数生成预测。输出包括 yhat,即预测值,以及 yhat_lower 和 yhat_upper,它们显示不确定性范围。
After Prophet, the next model to discuss is NeuralProphet because it builds on the same idea but adds more flexibility. NeuralProphet keeps the familiar Prophet-style structure of trend and seasonality, but it also adds neural network features such as autoregression, lagged values, covariates, and PyTorch-based training. This makes it useful when recent past values have a strong effect on future values. For example, in web traffic, electricity demand, or sales forecasting, the last few days or hours may strongly influence the next prediction. 在 Prophet 之后,下一个要讨论的模型是 NeuralProphet,因为它建立在相同的理念之上,但增加了更多灵活性。NeuralProphet 保留了 Prophet 熟悉的趋势和季节性结构,但增加了神经网络功能,如自回归、滞后值、协变量和基于 PyTorch 的训练。这使得它在近期过去值对未来值有强烈影响时非常有用。例如,在网络流量、电力需求或销售预测中,最近几天或几小时的数据可能对下一个预测有强烈影响。
NeuralProphet is a good choice when Prophet is too simple but the team still wants a model that is easier to understand than a fully black-box deep learning model. It acts as a bridge between traditional explainable forecasting and neural forecasting. Like Prophet, it uses ds for dates and y for target values, but it gives more room to capture short-term patterns and lag behavior. 当 Prophet 过于简单,但团队仍希望模型比完全黑盒的深度学习模型更容易理解时,NeuralProphet 是一个不错的选择。它充当了传统可解释预测和神经预测之间的桥梁。与 Prophet 一样,它使用 ds 表示日期,y 表示目标值,但它提供了更多空间来捕捉短期模式和滞后行为。

import pandas as pd
import torch
from neuralprophet import NeuralProphet, configure
import torch.serialization
import torch.nn as nn
import torch.optim as optim
# Patch torch.load to use weights_only=False
# This helps with NeuralProphet compatibility.
_original_torch_load = torch.load
def _patched_torch_load(*args, **kwargs):
kwargs.setdefault("weights_only", False)
return _original_torch_load(*args, **kwargs)
torch.load = _patched_torch_load
df = pd.DataFrame({
"ds": pd.date_range("2024-01-01", periods=200, freq="D"),
"y": range(200),
})
model = NeuralProphet()
metrics = model.fit(df, freq="D")
future = model.make_future_dataframe(df, periods=30)
forecast = model.predict(future)
print(forecast[["ds", "yhat1"]].tail())

This code creates a daily time series dataset with four columns: ds (dates), y (target values), temperature (lagged regressor), and promo (future regressor). 这段代码创建了一个包含四列的每日时间序列数据集:ds(日期)、y(目标值)、temperature(滞后回归变量)和 promo(未来回归变量)。
The model is initialized with n_lags=7 to use the past 7 days as autoregressive inputs and n_forecasts=3 to predict 3 steps ahead simultaneously. add_lagged_regressor("temperature") adds a covariate whose future values are unknown, while add_future_regressor("promo") adds one whose future values are known in advance and must be manually supplied in the future dataframe before calling predict(). 模型初始化时设置 n_lags=7,以使用过去 7 天作为自回归输入;n_forecasts=3 表示同时预测 3 步。add_lagged_regressor("temperature") 添加一个未来值未知的协变量,而 add_future_regressor("promo") 添加一个未来值已知且必须在调用 predict() 之前手动提供到未来数据框中的协变量。
After fitting, the output contains three forecast columns — yhat1, yhat2, and yhat3 — representing predictions 1, 2, and 3 days ahead respectively. 拟合后,输出包含三个预测列——yhat1、yhat2 和 yhat3——分别代表未来 1 天、2 天和 3 天的预测。
After Prophet and NeuralProphet, TimeGPT is the next forecasting tool to consider. Developed by Nixtla, it is a managed foundation model accessed through an API, so it does not require local training for each task.在 Prophet 和 NeuralProphet 之后,TimeGPT 是下一个值得考虑的预测工具。它由 Nixtla 开发,是一个通过 API 访问的托管基础模型,因此不需要为每个任务进行本地训练。
TimeGPT is useful for fast forecasting, zero-shot use cases, multiple time series, exogenous variables, and probabilistic forecasts. Its simplicity is the main advantage, but teams should consider privacy, cost, governance, and vendor dependency because it is closed source and API-based.TimeGPT 适用于快速预测、零样本用例、多时间序列、外生变量和概率预测。其简单性是主要优势,但团队应考虑隐私、成本、治理和供应商依赖性,因为它是闭源的且基于 API。

import os
import pandas as pd
from nixtla import NixtlaClient
df = pd.DataFrame({
"ds": pd.date_range("2024-01-01", periods=200, freq="D"),
"y": range(200),
})
client = NixtlaClient(api_key=os.environ["NIXTLA_API_KEY"])
forecast = client.forecast(
df=df,
h=30,
time_col="ds",
target_col="y",
)
# print(forecast.tail())
This code creates a simple daily time series dataset with two columns: ds and y. The ds column contains the dates, and the y column contains the values to forecast. The NixtlaClient is initialized using an API key stored in the environment variable NIXTLA_API_KEY. 这段代码创建了一个包含两列的简单每日时间序列数据集:ds 和 y。ds 列包含日期,y 列包含要预测的值。NixtlaClient 使用存储在环境变量 NIXTLA_API_KEY 中的 API 密钥进行初始化。
The forecast() sends the data to TimeGPT and asks for a 30-step forecast using h=30. The arguments time_col="ds" and target_col="y" tell TimeGPT which column contains time values and which column contains the target values. The output contains the future forecasted values returned by the API. forecast() 将数据发送到 TimeGPT 并使用 h=30 请求 30 步预测。参数 time_col="ds" 和 target_col="y" 告诉 TimeGPT 哪一列包含时间值,哪一列包含目标值。输出包含 API 返回的未来预测值。
Chronos is an open-weight foundation model from Amazon Science that offers more deployment control than closed APIs like TimeGPT. It treats forecasting like language modeling by converting time series values into tokens and predicting future values from those patterns.Chronos 是 Amazon Science 推出的开源权重基础模型,比 TimeGPT 等封闭 API 提供更多的部署控制。它将预测视为语言建模,通过将时间序列值转换为标记,并从这些模式中预测未来值。
It is useful for teams that want zero-shot forecasting with self-hosting, local testing, or cloud deployment. The family includes Chronos, Chronos-Bolt for faster and more memory-efficient forecasting, and Chronos-2 for multivariate and covariate-aware forecasting.它适用于希望进行零样本预测并支持自托管、本地测试或云部署的团队。该系列包括 Chronos、用于更快更节省内存预测的 Chronos-Bolt,以及支持多变量和协变量感知预测的 Chronos-2。

import torch
from chronos import BaseChronosPipeline
context = torch.tensor(list(range(200)), dtype=torch.float32)
pipeline = BaseChronosPipeline.from_pretrained(
"amazon/chronos-bolt-small",
device_map="cpu",
)
samples = pipeline.predict(
context=context,
prediction_length=30,
num_samples=20,
)
median_forecast = torch.median(samples, dim=0).values
# print(median_forecast)
This code creates a simple historical time series using PyTorch. The context variable stores the past values that Chronos will use to forecast the future. The BaseChronosPipeline.from_pretrained() loads a pretrained Chronos-Bolt model. In this example, the model runs on CPU. 这段代码使用 PyTorch 创建了一个简单的历史时间序列。context 变量存储 Chronos 将用于预测未来的过去值。BaseChronosPipeline.from_pretrained() 加载预训练的 Chronos-Bolt 模型。在此示例中,模型在 CPU 上运行。
The predict() function generates multiple possible future paths. The prediction_length=30 argument means the model forecasts the next 30 time steps, and num_samples=20 means it creates 20 possible forecast samples. Finally, the median forecast is calculated from those samples. This is useful because Chronos produces probabilistic forecasts rather than only one fixed prediction. predict() 函数生成多个可能的未来路径。prediction_length=30 参数表示模型预测未来 30 个时间步,num_samples=20 表示生成 20 个可能的预测样本。最后,从这些样本中计算中位数预测。这很有用,因为 Chronos 产生的是概率预测,而不仅仅是单一固定预测。
Prophet and NeuralProphet train on the user’s historical data as local forecasting models. Prophet uses trend, seasonality, holidays, and regressors, while NeuralProphet adds autoregression and neural components.Prophet 和 NeuralProphet 作为本地预测模型,在用户的历史数据上进行训练。Prophet 使用趋势、季节性、节假日和回归变量,而 NeuralProphet 增加了自回归和神经组件。
TimeGPT and Chronos use a foundation-model approach. TimeGPT works through a managed transformer API, while Chronos uses open-weight models that tokenize time series values. In general, Prophet and NeuralProphet are easier to explain, while TimeGPT and Chronos are stronger for zero-shot and probabilistic forecasting.TimeGPT 和 Chronos 使用基础模型方法。TimeGPT 通过托管的 Transformer API 工作,而 Chronos 使用将时间序列值标记化的开源权重模型。一般来说,Prophet 和 NeuralProphet 更容易解释,而 TimeGPT 和 Chronos 在零样本和概率预测方面更强。

| Feature | Prophet | NeuralProphet | TimeGPT | Chronos |
| Main approach | Additive statistical model | Hybrid neural forecasting model | Transformer foundation model | Token-based foundation model |
| Training style | Trained locally | Trained locally | API-based forecasting | Pretrained open-weight model |
| Interpretability | Very strong | Moderate to strong | Limited | Limited |
| Trend and seasonality | Explicit | Explicit | Learned implicitly | Learned implicitly |
| Lag learning | Limited | Stronger | Learned by model | Learned by model |
| Exogenous variables | Supported | Supported | Supported | Stronger in Chronos-2 |
| Probabilistic output | Prediction intervals | Quantile support | Supported | Supported through samples |
| Deployment | Local | Local | Managed API | Local or cloud |
| Best use case | Explainable business forecasting | Lag-aware forecasting | Fast managed forecasting | Open foundation-model forecasting |
Note: TimeGPT and Chronos require paid API keys. This makes Prophet and NeuralProphet the go-to choice for working on time series forecasting for free. 注意:TimeGPT 和 Chronos 需要付费 API 密钥。这使得 Prophet 和 NeuralProphet 成为免费进行时间序列预测的首选。
Benchmark results for Prophet, NeuralProphet, TimeGPT, and Chronos should be read carefully because they are not always tested under the same conditions. A fair comparison needs the same dataset, forecast horizon, train-test split, tuning process, and metrics.Prophet、NeuralProphet、TimeGPT 和 Chronos 的基准测试结果应谨慎解读,因为它们并非总是在相同条件下测试。公平的比较需要相同的数据集、预测范围、训练-测试分割、调优过程和指标。
Prophet is a strong explainable baseline, while NeuralProphet can help when short-term lag patterns matter. TimeGPT is useful for fast managed zero-shot forecasting, and Chronos-Bolt is a strong open foundation-model option. Still, teams should benchmark all models on their own data before choosing one for production.Prophet 是一个强大的可解释基线,而 NeuralProphet 在短期滞后模式重要时很有帮助。TimeGPT 适用于快速的托管零样本预测,Chronos-Bolt 是一个强大的开源基础模型选项。不过,团队仍应在自己的数据上对所有模型进行基准测试,然后再选择用于生产的模型。

| Tool | Performance Strength | Important Limitation |
| Prophet | Strong baseline for interpretable business forecasting | May miss short-term lag patterns |
| NeuralProphet | Can improve results when recent values matter | Needs more tuning and training |
| TimeGPT | Strong for fast zero-shot forecasting | Closed-source and API-dependent |
| Chronos | Strong open-weight foundation-model option | Less interpretable than Prophet |
| Classical baselines | Still competitive in some domains | May need careful tuning |
Scalability and latency matter because production forecasting often requires many forecasts at once. Prophet is reliable for small to medium workloads but can slow down across many individual series. NeuralProphet supports PyTorch and GPUs but still needs training and tuning. TimeGPT reduces local engineering through a managed API, while Chronos offers local or cloud deployment control. Chronos-Bolt is best when faster, memory-efficient forecasting is needed.可扩展性和延迟很重要,因为生产预测通常需要同时生成大量预测。Prophet 对于中小型工作负载可靠,但在多个独立序列上可能会变慢。NeuralProphet 支持 PyTorch 和 GPU,但仍需要训练和调优。TimeGPT 通过托管 API 减少本地工程工作,而 Chronos 提供本地或云部署控制。Chronos-Bolt 在需要更快、更节省内存的预测时是最佳选择。
For production, a forecasting model must fit the team’s deployment needs, not just predict well. Prophet is easy to debug and explain, while NeuralProphet adds flexibility but needs more tuning. TimeGPT is simple to adopt through an API, but raises cost, privacy, governance, and vendor-dependency concerns. Chronos supports open-weight self-hosting but requires more infrastructure planning. A good setup often pairs one transparent baseline with one advanced model.对于生产环境,预测模型必须符合团队的部署需求,而不仅仅是预测准确。Prophet 易于调试和解释,而 NeuralProphet 增加了灵活性但需要更多调优。TimeGPT 通过 API 易于采用,但会带来成本、隐私、治理和供应商依赖方面的顾虑。Chronos 支持开源权重自托管,但需要更多的基础设施规划。一个好的设置通常是将一个透明的基线模型与一个高级模型配对使用。
Time series forecasting now spans explainable tools like Prophet, flexible neural models like NeuralProphet, managed APIs like TimeGPT, and open-weight foundation models like Chronos. There is no universal best choice. 时间序列预测现在涵盖了 Prophet 等可解释工具、NeuralProphet 等灵活的神经模型、TimeGPT 等托管 API,以及 Chronos 等开源权重基础模型。没有 universally 的最佳选择。
Teams should compare models on their own data and choose based on accuracy, explainability, deployment needs, and business goals.团队应在自己的数据上比较模型,并根据准确性、可解释性、部署需求和业务目标进行选择。