Skip to main content

ML library reference

Per-framework reference for every model wrapper under alphaswarm/ml/models/. Configs live under configs/ml/.

Coverage matrix

LibraryWrapper(s)Optional extraExample config
scikit-learnSklearnRegressorModel, SklearnClassifierModel, SklearnPipelineModel, SklearnStackingModel, SklearnAutoPipelineModelmlsklearn_ridge_alpha.yaml, sklearn_stacking_alpha.yaml
LightGBMLGBModelmlalpha158_lgbm.yaml
XGBoostXGBModelml(in tree zoo)
CatBoostCatBoostModelml(in tree zoo)
Keras 3KerasMLPModel, KerasLSTMModel, KerasFunctionalModel, KerasTabTransformerModelml-keraskeras_mlp_alpha.yaml, keras_tab_transformer.yaml
TensorFlow nativeTFEstimatorModel (linear / DNN / boosted_trees)ml-tensorflow + ALPHASWARM_TF_NATIVE_ENABLED=truetf_estimator_dnn.yaml
PyTorch (qlib ports)LSTMTSModel, TransformerTSModel, TCNTSModel, TabNetModel, HISTModel, GATsModel, TRAModel, …ml-torchalpha360_*.yaml
ProphetProphetForecastModelml-forecastprophet_forecast_alpha.yaml
sktimeSktimeForecastModel, SktimeReductionForecastModel, AutoETSForecastModel, AutoARIMAForecastModel, ThetaForecastModel, BatsTbatsForecastModelml-forecastsktime_reduction_forecast.yaml, auto_ets_forecast.yaml, auto_arima_forecast.yaml, theta_forecast.yaml
PyODPyODAnomalyModel (iforest / knn / ecod / copod / lof / suod / auto_encoder / hbos / mcd / ocsvm / pca)ml-anomalypyod_anomaly_alpha.yaml, pyod_ecod_anomaly.yaml
HuggingFace transformersHuggingFaceTextSignalModel, HuggingFaceFinBertSentimentModel, HuggingFaceTimeSeriesModel, HuggingFaceGenerativeForecastModelml-transformers (+ ALPHASWARM_HF_TIMESERIES_ENABLED=true for time-series)huggingface_finbert_signal.yaml, hf_finbert_sentiment.yaml, hf_patchtst_forecast.yaml

Adhoc / notebook surface

alphaswarm.ml.adhoc exposes a quick_* namespace for one-off analyses without spelling out a full Experiment config:

from alphaswarm.ml.adhoc import (
quick_arima,
quick_ecod,
quick_finbert_sentiment,
quick_iforest,
quick_panel_fixed_effects,
quick_prophet,
quick_ridge,
quick_text_embed,
quick_theta,
)

# Linear / ridge / elasticnet
ridge = quick_ridge(features_df, target_series, alpha=1.0)
print(ridge.score, ridge.coefficients)

# Anomaly detection
iforest = quick_iforest(features_df, contamination=0.05)
print(iforest.n_anomalies)

# Forecasting
arima = quick_arima(series, horizon=10, order=(1, 1, 1))
prophet = quick_prophet(series, horizon=10)
theta = quick_theta(series, horizon=10)

# Embeddings & sentiment
embeds = quick_text_embed(headlines)
sentiment = quick_finbert_sentiment(headlines)

# Panel diagnostics
fe = quick_panel_fixed_effects(panel, target_col="y", entity_col="vt_symbol")

Where to add a new wrapper

  1. Implement the class under alphaswarm/ml/models/<library>.py, subclassing Model.
  2. Decorate with @register("Name", kind="model") from alphaswarm.core.registry.
  3. Make optional imports lazy (raise RuntimeError mentioning the right extra) so the rest of the registry keeps working.
  4. Add a YAML under configs/ml/frameworks/.
  5. Add a hermetic test under tests/ml/models/ that monkey-patches the optional dep when needed.
  6. Cross-list it here.

See alphaswarm_docs/ml-framework.md for the full registry + Experiment contract.