Alpha Research

Meta-labeling, feature importance, and alpha decay tracking

Meta-labeling is a two-model framework from AFML. The primary model predicts direction. The meta-label model decides whether to act on that prediction and how much to bet. This separation lets you have a simple directional model (e.g., trend following) combined with a sophisticated sizing model.

Meta-labeling

python
import horizon as hz

meta_labels = hz.compute_meta_labels(
    primary_predictions=predictions,  # +1 / -1 from primary model
    returns=forward_returns,          # actual forward returns
    barriers={
        "pt": 0.02,     # profit-taking threshold
        "sl": 0.01,     # stop-loss threshold
        "max_holding": 5,  # max bars to hold
    },
)
# meta_labels: 1 = primary was right, 0 = primary was wrong

Train a classifier on meta_labels using features like volatility, volume, time-of-day, etc. Use its probability output as bet size.

Feature importance

python
# Mean Decrease Accuracy (MDA)
importance = hz.mda_importance(model, X_test, y_test, n_repeats=10)

# Mean Decrease Impurity (MDI)
importance = hz.mdi_importance(model)

MDA is more reliable than MDI for financial data because MDI is biased toward high-cardinality features.

Alpha decay

python
decay = hz.alpha_decay(
    signal_series=signals,
    return_series=returns,
    max_lag=20,
)

print(f"Half-life: {decay.half_life:.1f} bars")
print(f"Decay rate: {decay.decay_rate:.4f}")

Measures how quickly your signal’s predictive power fades. Short half-life means you need to trade quickly (use Garleanu-Pedersen execution).

When to use

  • Meta-labeling: when your directional model is decent but your sizing is naive
  • Feature importance: during research to understand what’s actually driving predictions
  • Alpha decay: to set signal horizons and calibrate execution urgency

Next