Downloads · 30 days
0
oyi77/openmedallion-fints
openmedallion-fints is a time series forecasting model from oyi77. Use it for the time series forecasting task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Time-Series Forecasting Models for Financial Markets
Downloads · 30 days
0
Access
Public
Updated Jul 8, 2026
Repo size
1.1 MB
Likes
0
Public
Click a slice to open those files.
.pkl1.1 MB · 93%
From the Hugging Face model README
Time-Series Forecasting Models for Financial Markets
⚠️ CRITICAL DISCLAIMER: These models are for backtesting and research purposes only. They are NOT financial advice and should NOT be used for live trading without extensive validation. Financial markets are non-stationary, and past performance does not guarantee future results.
OpenMedallion-FinTS provides production-ready time-series forecasting models trained on the OpenMedallion dataset. The repository includes:
Models are trained separately per asset class (crypto, forex, commodities, equities) with strict temporal splitting to prevent data leakage.
from openmedallion_fints.models import LGBMForecaster
model = LGBMForecaster(
task='regression', # or 'classification'
n_estimators=500,
learning_rate=0.05,
max_depth=7,
num_leaves=31,
early_stopping_rounds=50
)
Features:
from openmedallion_fints.models import PatchTSTForecaster
model = PatchTSTForecaster(
lookback=64, # Input sequence length
horizon=1, # Forecast horizon
patch_len=16, # Patch size
stride=8, # Patch stride
d_model=128, # Model dimension
n_heads=4, # Attention heads
n_layers=3, # Transformer layers
d_ff=256, # Feedforward dimension
dropout=0.1
)
Features:
All models use strict temporal splits with NO random shuffling:
Example:
from openmedallion_fints.preprocessing import walk_forward_split
splits = walk_forward_split(
df=data,
n_splits=5,
train_size=0.7,
val_size=0.15,
test_size=0.15
)
from openmedallion_fints.eval import calculate_trading_metrics
metrics = calculate_trading_metrics(
y_true=actual_returns,
y_pred=predicted_returns,
benchmark_returns=buy_hold_returns
)
# Returns: sharpe_ratio, sortino_ratio, max_drawdown,
# calmar_ratio, profit_factor, hit_rate
Trained on OpenMedallion dataset with 80/20 temporal split, no random shuffling:
| Asset Class | Samples | MAE | RMSE | Direction Accuracy | Hit Rate |
|---|---|---|---|---|---|
| Equities | 27,901 | 0.249 | 0.458 | 87.79% | 87.79% |
| Crypto | 3,650 | 0.991 | 1.299 | 88.57% | 88.57% |
| Forex | 17,614 | 0.096 | 0.118 | 86.22% | 86.22% |
| Commodities | 49,584 | 1.696 | 2.065 | 74.56% | 74.56% |
Key Observations:
Trading Metrics (simulated backtest):
⚠️ WARNING: Trading metrics show unrealistically high values (infinite returns, NaN drawdowns) indicating the backtest strategy is overly simplified. These are statistical benchmarks only and do NOT represent realistic trading performance. Real-world trading requires proper risk management, transaction costs, slippage, and position sizing.
Pre-trained LightGBM models available for download:
lgbm_equities_regression.pkl (288KB)lgbm_crypto_regression.pkl (252KB)lgbm_forex_regression.pkl (292KB)lgbm_commodities_regression.pkl (290KB)Each model includes corresponding *_metrics.json file with full evaluation results.
python openmedallion-fints/scripts/train_lgbm.py \
--asset-class equities \
--split-method expanding \
--n-splits 5 \
--train-size 0.7 \
--val-size 0.15 \
--test-size 0.15 \
--task regression \
--n-estimators 500 \
--learning-rate 0.05 \
--max-depth 7 \
--early-stopping-rounds 50 \
--output-dir ./outputs/lgbm_equities
python openmedallion-fints/scripts/train_patchtst.py \
--asset-class crypto \
--split-method walk_forward \
--lookback 64 \
--horizon 1 \
--patch-len 16 \
--stride 8 \
--d-model 128 \
--n-heads 4 \
--n-layers 3 \
--batch-size 32 \
--epochs 50 \
--learning-rate 0.001 \
--device cuda \
--output-dir ./outputs/patchtst_crypto
from openmedallion_fints.models import LGBMForecaster
from openmedallion_fints.preprocessing import compute_features
import pandas as pd
# Load trained model
model = LGBMForecaster.load("./outputs/lgbm_equities/model.pkl")
# Prepare features
df = pd.read_parquet("your_ohlcv_data.parquet")
X, y = compute_features(df, lookback=20, horizon=1)
# Forecast
predictions = model.predict(X)
Apache License 2.0
This model is released under the Apache License 2.0. You are free to use, modify, and distribute this model for commercial or non-commercial purposes, with proper attribution.
See LICENSE for full terms.
@misc{openmedallion-fints-2026,
author = {oyi77},
title = {OpenMedallion-FinTS: Time-Series Forecasting for Financial Markets},
year = {2026},
publisher = {HuggingFace},
journal = {HuggingFace Model Hub},
howpublished = {\url{https://huggingface.co/oyi77/openmedallion-fints}}
}
Last Updated: 2026-07-08