Skip to content
Mementropy
SolutionsmeridianNotebookExecuted example

Meridian: forecast payment-operations staffing pressure

Forecast payment-operations case volume with NV-Tesseract and simple baselines, then ask whether costly shortages change the choice.

By Ryan HammangUpdated

Casebook links: FIN-01 / FIN-09 · Real pretrained model · Synthetic data · Rolling-origin evaluation

A financial-services operations manager needs the next three days of payment-exception case volume. Understaffing delays review; overstaffing wastes capacity. This predicts aggregate workload, not fraud, creditworthiness, market returns, or individual customer outcomes.

The saved example compares persistence, daily seasonality, direct NV-Tesseract forecasting, and DARR context-enhanced forecasting on three predeclared nonoverlapping future blocks. It then compares decisions when shortages cost more than excess capacity.

Dependency-incomplete download: this .ipynb preserves the lesson and its saved outputs, but is not a standalone runnable package. It does not include time_series_lab.py, time_series_prepare.py, time-series-model-lock.json, mementropy.mplstyle, the pinned upstream SDK checkout, or model assets. There is no verified public support bundle or locked Python environment for this download. Installing Jupyter alone will not make Run All work.

The original setup used Python 3.12 with Jupyter/IPython, NumPy, pandas, Matplotlib, PyTorch and the matching upstream SDK dependencies. Forecasting cells use pandas’ include_groups API (pandas 2.2 or later). These are prerequisites, not a tested installation recipe. The missing helper expected upstream code under .runtime/NV-Tesseract and model-family asset directories beside it. Its preparation step downloads assets; its activation step checks revisions and hashes before loading. The forecasting and anomaly packages share the sdk namespace and require separate fresh kernels.

Retained identities for an independently reviewed reconstruction:

  • Upstream NVIDIA/NV-Tesseract, revision 7fa53ac50abcd8829550d9399875f24170c1d0e8.
  • Forecasting model: nvidia/nv-tesseract-forecasting, revision abff20a58834638b28227ff4ab934f26206e4b09; required files include run8_best_model_cr.pt and standardizer.pkl.
  • Backbone: AutonLab/MOMENT-1-large, revision ca58581bc7bea2ebed4e80dc0a3e4b8b609c6ecc; required files include config.json and model.safetensors.

Use the official source and model cards linked below to review licenses, hardware support and security requirements before acquiring assets. Checkpoint and standardizer loading can deserialize code-capable formats; verify provenance and hashes in a disposable environment. The public download includes no weights or credentials. A complete helper distribution, dependency lock and clean-environment smoke test remain unverified; this page does not offer a one-command rerun.

Evidence: these are saved outputs from an earlier execution, not rerun for the 2026-10-29 editorial update. Rendering displays saved cells; it does not execute them. The public download is not a locked environment or a production validation.

from pathlib import Path
import sys, time, json, hashlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import display, Markdown, JSON
# Requires the separately prepared runtime described above; the public download is dependency-incomplete.
from time_series_lab import activate, features, anomaly_metrics, style, LOCK, RUNTIME
style()
weights = activate('forecast')
import torch
from dataclasses import replace
from sdk.forecasting import ForecastingConfig, perform_forecasting
DEVICE = 'mps' if torch.backends.mps.is_available() else 'cuda' if torch.cuda.is_available() else 'cpu'
print({'model': 'NV-Tesseract Forecasting', 'device': DEVICE,
'checkpoint_revision': LOCK['forecast']['revision'], 'backbone_revision': LOCK['backbone']['revision']})
{'model': 'NV-Tesseract Forecasting', 'device': 'mps', 'checkpoint_revision': 'abff20a58834638b28227ff4ab934f26206e4b09', 'backbone_revision': 'ca58581bc7bea2ebed4e80dc0a3e4b8b609c6ecc'}

This fixture has hourly seasonality, a weekly cycle, trend, correlated workload signals, and random noise. It is not a real retailer or bank extract. A reproducible synthetic fixture lets us inspect the mechanics without exposing customer records; it does not establish real-world generalization.

rng = np.random.default_rng(31)
t = np.arange(1500)
daily = np.sin(2*np.pi*t/24 - .5)
weekly = np.cos(2*np.pi*t/168)
values = 75 + 20*daily + 12*weekly + .012*t + rng.normal(0,4,len(t))
df = pd.DataFrame({
'timestamp': pd.date_range('2026-01-01', periods=len(t), freq='h'),
'cases_per_hour': values,
'activity_index': 50 + 12*daily + 6*weekly + rng.normal(0,1,len(t)),
'upstream_volume': 200 + 35*daily + .02*t + rng.normal(0,3,len(t)),
})
TARGET = 'cases_per_hour'
columns = [TARGET, 'activity_index', 'upstream_volume']
features(df, columns) # Reject missing data, duplicate/out-of-order timestamps and labels.
origins = [1280, 1352, 1424]
HORIZON = 72
assert all(b-a >= HORIZON for a,b in zip(origins,origins[1:]))
fig, ax = plt.subplots(figsize=(11,4))
ax.plot(df.timestamp, df[TARGET], linewidth=.8)
for origin in origins:
ax.axvspan(df.timestamp[origin], df.timestamp[origin+HORIZON-1], alpha=.12)
ax.set(title='Synthetic workload and three predeclared future blocks', ylabel=TARGET.replace('_',' '))
plt.tight_layout(); plt.show()
display(df.head())
2026-01-01 2026-01-08 2026-01-15 2026-01-22 2026-02-01 2026-02-08 2026-02-15 2026-02-22 2026-03-01 40 60 80 100 120 cases per hour Synthetic workload and three predeclared future blocks
timestamp cases_per_hour activity_index upstream_volume
0 2026-01-01 00:00:00 75.830284 50.650221 185.971740
1 2026-01-01 01:00:00 83.340179 53.952548 186.571939
2 2026-01-01 02:00:00 89.890890 54.182505 203.248645
3 2026-01-01 03:00:00 88.702698 57.334880 213.729518
4 2026-01-01 04:00:00 100.390547 60.360508 213.876172

At each origin, the model receives only the preceding 512 observations. DARR’s retrieval library ends before that input window starts, so its historical continuations cannot contain held-out future values. The supplied checkpoint and standardizer are frozen; we do not fit them on this fixture. Past auxiliary channels are available, but future auxiliary values are never provided.

The model’s native head is 72 points. We keep sequence length 512 and horizon 72, use three forecast origins, and fix DARR at 20% direct forecast / 80% historical retrieval before looking at errors.[2] This is a small demonstration, not hyperparameter optimization. Sequential forecast blocks emulate later decision times: once a block becomes history it is legitimately observable at the next origin.

config = ForecastingConfig(
target_column=TARGET, seq_len=512, forecast_horizon=HORIZON, model_horizon=72,
ckpt=str(weights/'run8_best_model_cr.pt'),
standardizer_pkl=str(weights/'standardizer.pkl'),
model_name=str(RUNTIME/'backbone'), local_files_only=True,
device=DEVICE, num_workers=0, batch_size=4, use_cross_channel=True,
alpha=.2, k=4, context_stride=72, seed=42,
)
rows, timings = [], []
for origin in origins:
history = df.iloc[origin-512:origin].copy()
context = df.iloc[:origin-512].copy()
future = df.iloc[origin:origin+HORIZON].copy()
assert context.timestamp.max() < history.timestamp.min() < future.timestamp.min()
assert history.timestamp.max() < future.timestamp.min()
started = time.perf_counter()
direct = perform_forecasting(df=history, config=config)
darr = perform_forecasting(df=history, config=config, context_df=context)
timings.append(time.perf_counter()-started)
assert direct.timestamp.tolist() == future.timestamp.tolist()
assert darr.timestamp.tolist() == future.timestamp.tolist()
predictions = {
'Persistence': np.repeat(history[TARGET].iloc[-1], HORIZON),
'Daily seasonal': np.tile(history[TARGET].iloc[-24:].to_numpy(), 3),
'NV-Tesseract direct': direct[f'{TARGET}_forecast'].to_numpy(),
'NV-Tesseract DARR': darr[f'{TARGET}_forecast'].to_numpy(),
}
for method, prediction in predictions.items():
assert len(prediction) == HORIZON and np.isfinite(prediction).all()
rows.extend({'origin': origin, 'timestamp': timestamp, 'method': method,
'actual': float(actual), 'prediction': float(predicted)}
for timestamp,actual,predicted in zip(future.timestamp, future[TARGET], prediction))
results = pd.DataFrame(rows)
print(f'Executed {len(origins)} origins, two model modes per origin, on {DEVICE}.')
print('Seconds per origin (includes cold loading at the first origin):', np.round(timings,2).tolist())
Loading weights from local directory
UserWarning: Only reconstruction head is pre-trained; others need fine-tuning.
Executed 3 origins, two model modes per origin, on mps.
Seconds per origin (includes cold loading at the first origin): [6.87, 0.25, 0.27]

Read the forecast, not just a headline score

Section titled “Read the forecast, not just a headline score”

MAE averages absolute errors; WAPE divides total absolute error by total actual volume. Report all origins, not the prettiest one. No claim about model superiority is required for this notebook to succeed: an honest baseline win is useful evidence.

results['absolute_error'] = (results.prediction-results.actual).abs()
metrics = results.groupby('method').apply(lambda group: pd.Series({
'MAE': group.absolute_error.mean(),
'WAPE_pct': 100*group.absolute_error.sum()/group.actual.abs().sum(),
}), include_groups=False).sort_values('MAE')
display(metrics.round(3))
display(results.groupby(['origin','method']).absolute_error.mean().unstack().round(2))
first = results[results.origin == origins[0]]
fig, ax = plt.subplots(figsize=(11,5))
actual = first[first.method=='Persistence']
ax.plot(actual.timestamp, actual.actual, color='#171817', linewidth=2, label='Actual future (evaluation only)')
for method in ['Daily seasonal', 'NV-Tesseract direct', 'NV-Tesseract DARR']:
subset = first[first.method==method]
ax.plot(subset.timestamp, subset.prediction, label=method)
ax.set(title='First forecast block — every method faces the same unseen future', ylabel=TARGET.replace('_',' '))
ax.legend(fontsize=9); plt.tight_layout(); plt.show()
MAE WAPE_pct
method
NV-Tesseract direct 7.711 8.423
NV-Tesseract DARR 9.530 10.410
Daily seasonal 12.694 13.865
Persistence 19.214 20.987
method Daily seasonal NV-Tesseract DARR NV-Tesseract direct Persistence
origin
1280 15.89 12.41 9.59 14.86
1352 12.34 8.88 6.73 28.59
1424 9.85 7.30 6.81 14.19
02-23 12 02-24 00 02-24 12 02-25 00 02-25 12 02-26 00 60 70 80 90 100 110 120 130 cases per hour First forecast block — every method faces the same unseen future Actual future (evaluation only) Daily seasonal NV-Tesseract direct NV-Tesseract DARR

The business decision is case-handling slots, not a low error score. For illustration, count each unit of underprediction as four cost units and overprediction as one. These are assumptions, not measured dollars, service-level guarantees, or an inventory/queueing optimization. We clip negative predictions to zero only for this nonnegative capacity decision, not to improve the reported forecast MAE.

Compare a declared 10% planning buffer with no buffer. This teaches the separation between a statistical forecast and a decision policy. Do not select a buffer on these test results and then describe its savings as out-of-sample.

policies = []
for buffer in [0., .10]:
planned = results.prediction.clip(lower=0)*(1+buffer)
shortage = (results.actual-planned).clip(lower=0)
excess = (planned-results.actual).clip(lower=0)
scored = results.assign(cost=4*shortage+excess, shortage=shortage)
table = scored.groupby('method')[['cost','shortage']].sum()
table['buffer_pct'] = int(buffer*100)
policies.append(table.reset_index())
policy_table = pd.concat(policies, ignore_index=True)
display(policy_table.round(2))
fig, ax = plt.subplots(figsize=(11,4))
policy_table.pivot(index='method',columns='buffer_pct',values='cost').plot.barh(ax=ax)
ax.set(title='Toy asymmetric cost: forecast choice and planning buffer both matter', xlabel='Assumed cost units')
ax.legend(title='Buffer %'); plt.tight_layout(); plt.show()
best = metrics.index[0]
lowest_cost = policy_table.sort_values('cost').iloc[0]
display(Markdown(f"**Decision insight:** the lowest assumed cost is {lowest_cost['method']} with a {int(lowest_cost['buffer_pct'])}% buffer. The MAE winner is {best}. These answer different questions: how close is the forecast, and what does the proposed action cost? This is exploratory policy comparison, not validated savings."))
display(Markdown(f"**Observed:** {best} has the lowest aggregate MAE on these three synthetic blocks. "
"Use the origin-level table to check consistency. "
"DARR retrieval is worth investigating only if it adds value beyond simple seasonality and its compute cost. "
"Carry the declared loss function into a separate real-data validation, rather than promising savings from this toy run."))
method cost shortage buffer_pct
0 Daily seasonal 8063.93 1774.04 0
1 NV-Tesseract DARR 7585.56 1842.34 0
2 NV-Tesseract direct 4535.18 956.53 0
3 Persistence 6817.55 889.11 0
4 Daily seasonal 5640.84 910.05 10
5 NV-Tesseract DARR 3771.31 716.51 10
6 NV-Tesseract direct 2820.47 223.04 10
7 Persistence 6536.16 389.90 10
0 1000 2000 3000 4000 5000 6000 7000 8000 Assumed cost units Daily seasonal NV-Tesseract DARR NV-Tesseract direct Persistence method Toy asymmetric cost: forecast choice and planning buffer both matter Buffer % 0 10

Decision insight: the lowest assumed cost is NV-Tesseract direct with a 10% buffer. The MAE winner is NV-Tesseract direct. These answer different questions: how close is the forecast, and what does the proposed action cost? This is exploratory policy comparison, not validated savings.

Observed: NV-Tesseract direct has the lowest aggregate MAE on these three synthetic blocks. Use the origin-level table to check consistency. DARR retrieval is worth investigating only if it adds value beyond simple seasonality and its compute cost. Carry the declared loss function into a separate real-data validation, rather than promising savings from this toy run.

A forecast is conditional on the patterns it can observe. Reuse the already frozen predictions against a counterfactual 40% workload surge; no model sees the surge beforehand. This is a stress test, not a second independent accuracy benchmark. It makes the operational limitation visible without cherry-picking a nicer model run.

shock = results.copy()
shock['actual'] *= 1.4
stress = shock.groupby('method').apply(lambda group: (group.prediction-group.actual).abs().mean(), include_groups=False)
display(pd.DataFrame({'original_MAE': metrics.MAE, 'unannounced_surge_MAE': stress}).round(2))
assert np.array_equal(shock.prediction.to_numpy(), results.prediction.to_numpy())
print('Predictions remained frozen; only the synthetic counterfactual outcomes changed.')
original_MAE unannounced_surge_MAE
method
Daily seasonal 12.69 40.37
NV-Tesseract DARR 9.53 44.15
NV-Tesseract direct 7.71 37.77
Persistence 19.21 30.54
Predictions remained frozen; only the synthetic counterfactual outcomes changed.
  • Use the actual forecast decision time to decide which inputs are legal. A timestamp split alone is insufficient if retrieval includes future continuations.
  • Keep persistence and seasonal baselines. Complexity needs a measured benefit.
  • Backtest across many origins, peak periods, and segments; reserve an untouched final interval for policy selection validation.
  • Use domain owners to set shortage/excess costs and escalation rules. The model must not automatically order stock, schedule staff, move funds, or change customer decisions.
  • These plots do not measure realized margin, staffing savings, fraud reduction, or production reliability. Record those separately in a human-reviewed pilot.

The receipt below comes from the actual run.

display(JSON({'case_id': 'FIN-01 / FIN-09', 'model': 'nvidia/nv-tesseract-forecasting',
'device': DEVICE, 'origins': origins, 'horizon': HORIZON,
'seconds': [round(value,3) for value in timings],
'protocol': 'rolling-origin-disjoint-retrieval',
'metrics': metrics.to_dict(orient='index'),
'decision_policies': policy_table.to_dict(orient='records')}))
{
  "case_id": "FIN-01 / FIN-09",
  "decision_policies": [
    {
      "buffer_pct": 0,
      "cost": 8063.93214702967,
      "method": "Daily seasonal",
      "shortage": 1774.040738074709
    },
    {
      "buffer_pct": 0,
      "cost": 7585.557872810879,
      "method": "NV-Tesseract DARR",
      "shortage": 1842.3379617692215
    },
    {
      "buffer_pct": 0,
      "cost": 4535.179299787493,
      "method": "NV-Tesseract direct",
      "shortage": 956.5270970180599
    },
    {
      "buffer_pct": 0,
      "cost": 6817.547087837367,
      "method": "Persistence",
      "shortage": 889.1144867830174
    },
    {
      "buffer_pct": 10,
      "cost": 5640.842016508132,
      "method": "Daily seasonal",
      "shortage": 910.0498302884487
    },
    {
      "buffer_pct": 10,
      "cost": 3771.3079647029786,
      "method": "NV-Tesseract DARR",
      "shortage": 716.512306319516
    },
    {
      "buffer_pct": 10,
      "cost": 2820.470256364792,
      "method": "NV-Tesseract direct",
      "shortage": 223.03609949074584
    },
    {
      "buffer_pct": 10,
      "cost": 6536.163155627828,
      "method": "Persistence",
      "shortage": 389.89989471383376
    }
  ],
  "device": "mps",
  "horizon": 72,
  "metrics": {
    "Daily seasonal": {
      "MAE": 12.693564503729366,
      "WAPE_pct": 13.865090422943485
    },
    "NV-Tesseract DARR": {
      "MAE": 9.530296238440807,
      "WAPE_pct": 10.40987494604827
    },
    "NV-Tesseract direct": {
      "MAE": 7.711101892283858,
      "WAPE_pct": 8.422781872312909
    },
    "Persistence": {
      "MAE": 19.213905682816275,
      "WAPE_pct": 20.98721281889625
    }
  },
  "model": "nvidia/nv-tesseract-forecasting",
  "origins": [
    1280,
    1352,
    1424
  ],
  "protocol": "rolling-origin-disjoint-retrieval",
  "seconds": [
    6.867,
    0.245,
    0.273
  ]
}

The source article frames forecasting as one task in a purpose-built model family.[1] This notebook uses NVIDIA’s later public forecasting release: a MOMENT-based backbone with a trained forecasting head and optional DARR retrieval from historical windows.[2][3] Neither the synthetic fixture nor the MAE/cost results here reproduce NVIDIA’s benchmarks. The model card labels the model for research and development.[3] No classification checkpoint is assumed. These are original teaching extensions of the enterprise casebooks, not completed enterprise implementations.

[1] https://developer.nvidia.com/blog/new-nvidia-nv-tesseract-time-series-models-advance-dataset-processing-and-anomaly-detection — New NVIDIA NV-Tesseract Time Series Models Advance Dataset Processing and Anomaly Detection

[2] https://github.com/NVIDIA/NV-Tesseract

[3] https://huggingface.co/nvidia/nv-tesseract-forecasting