Overview of the Jesse ML pipeline workflow
The jesse.research module provides a pipeline for integrating machine learning into trading strategies. The typical workflow consists of five stages:
- Strategy Development: Implement
record_features({...})at signal bars andrecord_label(name, value)when outcomes are known. Usebefore()/after()for continuous observation oron_open_position/on_close_positionfor trade-based labeling. - Data Gathering: Run
gather_ml_data()to collect labeled samples. Data is auto-saved tostrategies/<Name>/ml_data/<Name>_data.csv. A healthy sample range is 2,000–5,000 points. - Model Training: Run
train_model()with a scikit-learn compatible estimator. This producesmodel.pkl,scaler.pkl, andfeature_importance.pklin the strategy folder. - Deployment: Set
self.ml_mode = "deploy"in the strategy. Useml_predict()(regression) orml_predict_proba()(classification) to filter or weight signals. - Evaluation: Backtest the filtered strategy against the baseline and iterate on features or estimators.
from jesse.research import (
gather_ml_data,
load_ml_data_csv,
train_model,
)