Runs quantitative ML workflows: walk-forward folds, PCA regressors, LASSO index tracking, and scikit-learn/XGBoost model training and prediction via `uv run qs ml`.
Ships in quantspace. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use the uv run qs ml commands below; research tasks do not require reading
skills/ml/ source. Each command prints one JSON envelope on stdout (ok,
data, artifacts, warnings, or error with a hint). Exact options:
uv run qs ml <command> --help or uv run qs schema ml.<command>. Model
dependencies need uv sync --extra ml.
uv run qs ml folds --panel out/panel.parquet --min-train 250 --retrain-step 100 --purge 20
uv run qs ml factor-rank --panel out/panel.parquet \
--factors '[{"indicator": "roc", "params": {"period": 5}, "name": "roc5"},
{"indicator": "rsi", "params": {"period": 14}, "name": "rsi"}]' \
--output out/factor_rank.parquet
uv run qs ml pca-predict --train out/train.parquet --predict out/predict.parquet \
--target-col forward_return --model ols --n-pca 5 --output out/predictions.parquet
uv run qs ml lasso-track --panel out/panel.parquet --index-symbol 000300.SH \
--lookback 120 --min-periods 60 --output out/lasso_weights.parquet
uv run qs ml train --train out/train.parquet --target state --model-name lr --namespace demo
uv run qs ml train --train out/train.parquet --target state --model-name lr --namespace demo --write
uv run qs ml predict --data out/predict.parquet --namespace demo --model-id <model_id> \
--output out/ml_predictions.parquet
--panel is a (symbol, eob) OHLCV table from qs store read.--train, --predict, and --data are feature tables with one row per
date; --train also holds the target column. Build them from
qs compute features joined with qs compute labels.factor-rank writes a wide date by symbol rank table, the --scores input
of qs strategy top-n.train --write stores the model under data/models/<namespace>/; without
--write it only reports the plan. predict refuses models saved by the old
PyCaret engine; train them again.--model-name (train) and --model (factor-rank) take the ids listed in
--help; --model-params passes estimator arguments such as
{"n_estimators": 200}.MLFactorEngine,
walk-forward folds, PCA fold transforms, LASSO tracking, and the MLEngine
model registry. Read it when changing this Skill or writing strategy code.Before using a command, run it with --help to see its options and defaults. uv run qs schema <skill>.<command> shows its input and output fields; add --file-field FIELD for the structure of an option that takes a JSON file.
| Command | What it does | Side effects |
|---|---|---|
uv run qs ml factor-rank | Train MLFactorEngine on factor features and write cross-sectional ranks. | writes-output |
uv run qs ml lasso-track | Rolling LASSO index-tracking weights. | writes-output |
uv run qs ml folds | Expanding walk-forward folds with label purge. | read-only |
uv run qs ml pca-predict | Fit train-only PCA and a frozen regressor, then predict rows. | writes-output |
uv run qs ml train | Train a scikit-learn or XGBoost MLEngine model and save it to the model registry. | writes-store |
uv run qs ml predict | Predict with a registry model. | writes-output |
__init__.py (opens in a new tab)cli.py (opens in a new tab)estimators.py (opens in a new tab)lasso_tracker.py (opens in a new tab)ml_engine.py (opens in a new tab)ml_factor.py (opens in a new tab)pca_fold.py (opens in a new tab)references/python-api.md (opens in a new tab)walk_forward.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/analyzeMeasure returns (performance metrics, drawdowns, overfitting tests), screen factors by IC, grouped returns, horizon and lag IC surfaces, and factor correlation, run deterministic factor preflight and evaluation, and test stationarity with `uv run qs analyze ...`./backtestRun date-by-symbol target weights (or whole lots, booked by quantity with futures on the contracts actually held) through the shared vectorized backtester, convert votes into weights (equal, risk parity, inverse variance), apply market overlays, blend strategy return streams, and price A-share trigger-time costs with `uv run qs backtest ...`./computeCompute technical indicators and factor values on OHLCV panels, build log-difference features and forward-return or triple-barrier labels, resample one-minute bars to five minutes, and forward-adjust stored bars with `uv run qs compute ...`./quantspace:mlfrom quantspace
quantspace@quantskills is listed by quantskills/registry — review the source before installing
npx claudepluginhub quantskills/registry --plugin quantspaceOther plugins' skills for the same job