Payments Forecasting

Forecast gross payment volume (GPV) across merchants using panel data with 44 entities tracked over 41 time periods.

Dataset Exploration

The Payments dataset tracks financial transaction patterns and payment processing metrics. Features include currency type, territory, payment provider, and payment method flags. The target variable (GPV) represents gross payment volume.

Panel data structure: 44 merchants tracked over 41 time periods (1,804 total rows, 9 columns).

Fit Data (first 5 rows)

iddategpvcurrency_eurterritory_FRterritory_ITpprovider_stripepaymenttype_linkpaymenttype_sepa_debit
id444621332804.72falsefalsefalsetruefalsefalse
id44465225440.27falsefalsefalsetruefalsefalse
id44480533363.04falsefalsefalsetruefalsefalse
id44468210024.33falsefalsefalsetruefalsefalse
id4448961950.75falsefalsefalsetruefalsefalse

Forecast Data (first 3 rows)

The forecast file covers future periods without the gpv target column.

iddatecurrency_eurterritory_FRterritory_ITpprovider_stripepaymenttype_linkpaymenttype_sepa_debit
id045809falsefalsefalsetruefalsefalse
id045839falsefalsefalsetruefalsefalse
id045870falsefalsefalsetruefalsefalse

Download sample datasets from GitHub

Code Walkthrough

Step 1: Initialize

Python
import pandas as pd
from datfid import DATFIDClient

client = DATFIDClient(token="your_DATFID_token")

Step 2: Fit the Model

Python
url_fit = "https://raw.githubusercontent.com/datfid-valeriidashuk/sample-datasets/main/Payments.xlsx"
df = pd.read_excel(url_fit)

result = client.fit_model(
    df=df,
    id_col="id",
    time_col="date",
    y="gpv",
    current_features="all",
    filter_by_significance=True
)

Step 3: Forecast

Python
url_forecast = "https://raw.githubusercontent.com/datfid-valeriidashuk/sample-datasets/main/Payments_forecast.xlsx"
df_forecast = pd.read_excel(url_forecast)

forecast = client.forecast_model(df_forecast=df_forecast)

Analysis Results (Model Fit)

Formula

gpv ~ α1*Intercept + α2*territory_FR + α3*paymenttype_sepa_debit + α4*currency_eur + α5*paymenttype_link

Alpha Estimates (Time-Invariant)

All features in this dataset are time-invariant (entity characteristics), so there are no time-varying betas.

VariableEstimateT-statInterpretation
Intercept12,1569.80Baseline GPV level
currency_eur-11,6644.63EUR-denominated merchants have ~$11.7K lower GPV
paymenttype_link-12,0732.65Link payment merchants have ~$12K lower GPV
territory_FR+2,1500.69Not statistically significant (p=0.49)
paymenttype_sepa_debit-1,3470.20Not statistically significant (p=0.84)

Model Performance

0.018
R² Overall
0.114
R² Between
0
R² Within
12,577
MAE
1.57e9
MSE

The Payments dataset has high merchant-level variance and limited features. Adding time-varying features or lagged variables would likely improve model fit.

Try it yourself: Select "Payments" in the Free Playground.