Skip to main content

A multiverse of prophet models, for forecasting and Marketing Mix Modeling.

Project description

Prophetverse

PyPI version codecov

Prophetverse leverages the theory behind the Prophet model for time series forecasting and expands it into a more general framework, enabling custom priors, non-linear effects for exogenous variables and other likelihoods. Built on top of sktime and numpyro, Prophetverse aims to provide a flexible and easy-to-use library for time series forecasting with a focus on interpretability and customizability. It is particularly useful for Marketing Mix Modeling, where understanding the effect of different marketing channels on sales is crucial.

Table of Contents

🚀 Installation

To install with pip:

pip install prophetverse

Or with poetry:

poetry add prophetverse

📊 Forecasting with default hyperparameters

Prophetverse model provides an interface compatible with sktime. Here's how to use it:

from prophetverse.sktime import Prophetverse

# Create the model
model = Prophetverse()

# Fit the model
model.fit(y=y, X=X)

# Forecast in sample
y_pred = model.predict(X=X, fh=[1,2,3,4])

🌟 Features & Comparison with Meta's Prophet

Prophetverse is similar to the original Prophet model in many aspects, but it has some differences and new features. The following table summarizes the main features of Prophetverse and compares them with the original Prophet model:

Feature Prophetverse Original Prophet Motivation
Logistic trend Capacity as a random variable Capacity as a hyperparameter, user input required The capacity is usually unknown by the users. Having it as a variable is useful for Total Addressable Market inference
Custom trend Customizable trend functions Not available Users can create custom trends and leverage their knowledge about the timeseries to enhance long-term accuracy
Likelihoods Gaussian, Gamma and Negative Binomial Gaussian only Gaussian likelihood fails to provide good forecasts to positive-only and count data (sales, for example)
Custom priors Supports custom priors for model parameters and exogenous variables Not supported Forcing positive coefficients, using prior knowledge to model the timeseries
Custom exogenous effects Non-linear and customizable effects for exogenous variables, shared coefficients between time series Not available Users can create any kind of relationship between exogenous variables and the timeseries, which can be useful for Marketing Mix Modeling and other applications.
Changepoints Uses changepoint interval Uses changepoint number The changepoint number is not stable in the sense that, when the size of timeseries increases, its impact on forecast changes. Think about setting a changepoint number when timeseries has 6 months, and forecasting in future with 2 years of data (4x time original size). Re-tuning would be required. Prophetverse is expected to be more stable
Scaling Time series scaled internally, exogenous variables scaled by the user Time series scaled internally Scaling y is needed to enhance user experience with hyperparameters. On the other hand, not scaling the exogenous variables provide more control to the user and they can leverage sktime's transformers to handle that.
Seasonality Fourier terms for seasonality passed as exogenous variables Built-in seasonality handling Setting up seasonality requires almost zero effort by using LinearFourierSeasonality in Prophetverse. The idea is to allow the user to create custom seasonalities easily, without hardcoding it in the code.
Multivariate model Hierarchical model with multivariate normal likelihood and LKJ prior, bottom-up forecast Not available Having shared coefficients, using global information to enhance individual forecast.
Implementation Numpyro Stan

🤝 Contributing to Prophetverse

We welcome contributions! Check out our contributing guidelines to get started.

📚 Documentation

Detailed documentation is available here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prophetverse-0.7.2.tar.gz (361.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prophetverse-0.7.2-py3-none-any.whl (386.7 kB view details)

Uploaded Python 3

File details

Details for the file prophetverse-0.7.2.tar.gz.

File metadata

  • Download URL: prophetverse-0.7.2.tar.gz
  • Upload date:
  • Size: 361.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.11.0-1015-azure

File hashes

Hashes for prophetverse-0.7.2.tar.gz
Algorithm Hash digest
SHA256 51f30187fcd8026730b3c228498cc5cc817e26fcf888cb0372f6dd45c4a1801e
MD5 9de9ba6168258b8b6266e269dbe3f90c
BLAKE2b-256 93ead6afb2cb14eff90f72a11503455ea52db9d6f0262fc5339fd1bde68a721e

See more details on using hashes here.

File details

Details for the file prophetverse-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: prophetverse-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 386.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.11.0-1015-azure

File hashes

Hashes for prophetverse-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f4a2823a6a3fa0cb05ede18e8ddce447aa574232f01a7288abf8220f5b0c26a3
MD5 1247252d8a0e0ed607e59c1b97c377dd
BLAKE2b-256 cf86b3b3654ff0c2771ee7abfc5e7d0ac908d919e4943ec9e816e224d87c72a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page