ml4t-models is organized around model semantics, not around one generic trainer
abstraction.
The fastest way to understand the library is to ask four questions:
- what data contract does the model require?
- what object does it estimate?
- what is the native output?
- what still has to happen before you can trade or backtest it?
The core design choice is simple: do not force structurally different finance models through
one artificial fit/predict story. A latent-factor model, a stochastic discount factor
model, a direct supervised predictor, and an end-to-end portfolio learner may all use neural
networks, but they are not estimating the same object.
Used by:
PCAModelRPPCAModelIPCAModelCAEModel
Workflow:
batch -> structural model -> latent factor state -> factor forecaster -> asset mapper
This is the right abstraction for models where:
- exposures and factor realizations are the structural objects
- expected returns come from a separate premium forecast
Used by:
StochasticDiscountFactorModel
Workflow:
cross-section batch -> phase-aware no-arbitrage training -> asset weights + SDF series
This family is intentionally separate because the native object is a traded pricing-kernel proxy, not a latent factor plus a premium forecast.
Used by:
SAEModel
Workflow:
cross-section batch -> supervised autoencoder -> asset signals
This is where the library puts supervised models that predict asset-level signals directly.
Used by:
LinearFeaturePortfolioModelLSTMPortfolioModelDeepPortfolioModel
Workflow:
portfolio sequence batch -> allocation model -> target weights -> optional postprocessing
These models optimize allocation decisions directly rather than first estimating returns.
- Stable-ID panel models and ragged cross-sectional models use different contracts.
- Neural checkpoints are configurable rather than hard-coded.
- Forecasting is kept outside structural latent-factor estimation.
- Evaluation belongs in
ml4t-diagnostic, not in this library. - Execution belongs in
ml4t-backtest, not in this library.
If you want the economic logic first:
If you want to wire the library into a workflow quickly: