Aizen Trading โ Direction Classifier (h=4 bars)
Trained XGBoost model that predicts the directional probability of an
underlying's next-4-bars return. The 4-bar horizon is approximately
1 hour on a 15-minute bar grid. The model is a building block of the
multi-agent trading system described in
aizentrading/Aizen-Trading.
Model
- Task: binary classification (1 = up over the next 4 bars)
- Version:
direction_h4_xgb_clf-20260830-011107 - Created:
2026-08-29T19:41:07Z - Frozen params: tau = 0.0025, cost = 0.01
Features (20)
return_1return_4return_16volatility_16rsi_14macd_pcthl_rangeco_returnatr_pct_14ma_dist_20ma_dist_50volume_ratio_20volume_change_1trade_count_ratio_20vwap_distancespy_ret_1spy_ret_past_16spy_volatility_16qqq_ret_past_16qqq_volatility_16
Data splits
- train: ends
2025-08-08T20:45:00Z - val:
2025-08-11T12:00:00Zto2026-02-20T14:00:00Z - test: starts
2026-02-20T14:15:00Z
Metrics
- val roc_auc = 0.6463258541131558
- val pr_auc = 0.36070011854753803
- val log_loss = 0.6450614946857933
- val brier = 0.22855452006693983
- val precision@0.5 = 0.3479649721870353
- val recall@0.5 = 0.6302244389027432
- val base_rate = 0.26349681963938393
- val calibration = [{'bin_mid': 0.05, 'mean_pred': 0.0793294234085927, 'observed': 0.00663716814159292, 'n': 452}, {'bin_mid': 0.15, 'mean_pred': 0.14998908695049443, 'observed': 0.028065893837705917, 'n': 1639}, {'bin_mid': 0.25, 'mean_pred': 0.25641111146827555, 'observed': 0.09880239520958084, 'n': 2338}, {'bin_mid': 0.35, 'mean_pred': 0.35658407458094993, 'observed': 0.1767558828812646, 'n': 5567}, {'bin_mid': 0.45, 'mean_pred': 0.4537212282199295, 'observed': 0.2469422824219145, 'n': 9893}, {'bin_mid': 0.55, 'mean_pred': 0.5492492442457428, 'observed': 0.3280789007839501, 'n': 11863}, {'bin_mid': 0.65, 'mean_pred': 0.6377607116039763, 'observed': 0.3792553191489362, 'n': 5640}, {'bin_mid': 0.75, 'mean_pred': 0.7304015887573193, 'observed': 0.43618739903069464, 'n': 619}, {'bin_mid': 0.85, 'mean_pred': 0.8454932219841901, 'observed': 0.5, 'n': 34}, {'bin_mid': 0.95, 'mean_pred': 0.9107078909873962, 'observed': 0.0, 'n': 1}]
- test roc_auc = 0.6118948596743414
- test pr_auc = 0.3732239974591537
- test log_loss = 0.6767788485178338
- test brier = 0.24294212970952203
- test precision@0.5 = 0.3551783004552352
- test recall@0.5 = 0.6552357624004899
- test base_rate = 0.2939316019542299
- test calibration = [{'bin_mid': 0.05, 'mean_pred': 0.07620102362856668, 'observed': 0.045454545454545456, 'n': 374}, {'bin_mid': 0.15, 'mean_pred': 0.1497739998489453, 'observed': 0.06377079482439926, 'n': 1082}, {'bin_mid': 0.25, 'mean_pred': 0.2573866938346339, 'observed': 0.13621480026195154, 'n': 1527}, {'bin_mid': 0.35, 'mean_pred': 0.3592317883313968, 'observed': 0.21121883656509696, 'n': 4332}, {'bin_mid': 0.45, 'mean_pred': 0.45434612560638243, 'observed': 0.26051301611519023, 'n': 10487}, {'bin_mid': 0.55, 'mean_pred': 0.5491447498766312, 'observed': 0.33177327093083725, 'n': 13461}, {'bin_mid': 0.65, 'mean_pred': 0.6377690130531197, 'observed': 0.3871887188718872, 'n': 6666}, {'bin_mid': 0.75, 'mean_pred': 0.7316777400789112, 'observed': 0.46196868008948544, 'n': 894}, {'bin_mid': 0.85, 'mean_pred': 0.8224760400715159, 'observed': 0.44776119402985076, 'n': 67}]
Usage
import joblib
import pandas as pd
from huggingface_hub import hf_hub_download
pkl_path = hf_hub_download(
repo_id="AdithyaByri/direction-h4-clf",
filename="direction_h4_xgb_clf-*.pkl",
)
clf = joblib.load(pkl_path)
# `clf` is a sklearn-style XGBClassifier with .predict_proba(X)[:, 1]
proba = clf.predict_proba(X)[:, 1]
Provenance
Trained by the orchestrator's nightly retrain step
(src/agents/train_direction.py). Deployed via
scripts/deploy_to_hf.py. The model is re-trained daily on a
walk-forward split and the latest version replaces the previous one
on this hub.
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support