Skip to main content

Overview

run_ml_job trains a classical machine learning model on feature-engineered data and produces per-ticker next-day log-return predictions for the ML-enhanced portfolio path. Supported libraries:
  • scikit-learn — linear, ridge, lasso, elastic net, quantile, random forest, …
  • XGBoost, LightGBM, CatBoost — gradient-boosting regressors
This stage is optional. The default QuantLab path is data → PO → trading. Use ML when you want predicted returns as μ (mu_mode: custom in run_po_job).
For XGBoost, LightGBM, and CatBoost, QuantLab uses the regressor APIs (e.g. XGBRegressor, LGBMRegressor, CatBoostRegressor) to predict continuous returns — not classifiers or clustering.

Hyperparameters — full library power

Pass any constructor argument the chosen model accepts via model_params. The worker forwards those kwargs into the library’s estimator __init__, so you can use the full API surface of sklearn / XGBoost / LightGBM / CatBoost (learning rate, depth, subsample, reg_alpha, l1_ratio, random_state, and so on). Complete config values are shown below. Use one alongside the required feature_url and data_extractor_url from your own preceding jobs; these objects are not standalone tool requests.
In chat you can just say “XGBoost with max_depth 5 and 300 trees” — MCP skills fill in model_params.

Parameters

string
required
URL of feature_engine_*.json from run_feature_worker.
string
required
URL of data_extractor_*.json from run_data_extraction (train/test date alignment).
object
required
ML configuration.

Returns

effective_params is what the run actually used. A remapped alias, a rounded cv_test_size or an ignored block leaves the run Succeeded and shows up in coercions / warnings — read them before passing the forecasts on. If you want neural networks instead of classical models, use run_dl_job — its nn_engine_*.json is interchangeable with this output downstream.

Example


Next Step

  • Pass output_url to run_po_job as input_url. On an ml_engine_ input the optimizer defaults to mu_mode: "custom", so the forecasts act as expected returns.
  • Before that, it is worth looking at the forecasts themselves: run_plot_job with block_name: "ml_visualization" and tool_name: "plot_compare_pred_vs_real_for_ticker" puts predicted and realized returns on one chart.