量的金融のためのオープンソース ML モデル
機械学習トレーディングアルゴリズムは、統計的学習モデル(勾配ブースティング、ニューラルネットワーク、Transformer)を金融時系列データに適用し、価格変動を予測したり取引シグナルを生成します。これらのオープンソース実装は、回帰(価格目標)と分類(方向)の両方の定式化をカバーします。
ML アルゴリズムがライブラリ間でどう接続するか
ML アルゴリズムがトレーディングシステムでどう連携するか
Price, volume, indicators
Model predictions
Signal threshold filtering
Profit taking & stop loss
Position sizing & portfolio
主要な観点で ML アルゴリズムを比較
| 項目 | LightGBMRegressorFreqtrade | LightGBMClassifierFreqtrade | XGBoostRegressorFreqtrade | XGBoostClassifierFreqtrade | CatboostRegressorFreqtrade | PyTorchMLPRegressorFreqtrade | PyTorchTransformerRegressorFreqtrade | LGBModelQlib (Microsoft) | XGBModelQlib (Microsoft) | DNNModelQlib (Microsoft) | ALSTMQlib (Microsoft) | TFTModelQlib (Microsoft) | GATsQlib (Microsoft) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 複雑度 | ⭐⭐⭐intermediate | ⭐⭐⭐intermediate | ⭐⭐⭐intermediate | ⭐⭐⭐intermediate | ⭐⭐⭐intermediate | ⭐⭐⭐⭐advanced | ⭐⭐⭐⭐advanced | ⭐⭐⭐intermediate | ⭐⭐⭐intermediate | ⭐⭐⭐⭐advanced | ⭐⭐⭐⭐advanced | ⭐⭐⭐⭐advanced | ⭐⭐⭐⭐advanced |
| 予測タイプ | 回帰 | 分類 | 回帰 | 分類 | 回帰 | 回帰 | 回帰 | 混合 | 混合 | 混合 | シーケンス | 混合 | 混合 |
| 学習速度 | ⚡⚡⚡ | ⚡⚡⚡ | ⚡⚡⚡ | ⚡⚡⚡ | ⚡⚡ | ⚡⚡ | ⚡ | ⚡⚡ | ⚡⚡ | ⚡⚡ | ⚡ | ⚡⚡ | ⚡⚡ |
| 精度 | 📊📊📊 | 📊📊📊 | 📊📊📊 | 📊📊📊 | 📊📊📊 | 📊📊📊 | 📊📊📊📊 | 📊📊 | 📊📊 | 📊📊 | 📊📊📊 | 📊📊 | 📊📊📊📊 |
| 最適用途 | 表形式データ | 表形式データ | 表形式データ | 表形式データ | 汎用 | 非線形パターン | 時系列パターン | 汎用 | 汎用 | 汎用 | シーケンシャルデータ | 汎用 | グラフ関係 |
Gradient boosting regression model for price movement prediction using LightGBM.
| n_estimators | 1000 | Number of boosting rounds |
| learning_rate | 0.01 | Step size shrinkage |
freqai/prediction_models/LightGBMRegressor.pyGradient boosting classification model for directional prediction (up/down/neutral).
| n_estimators | 1000 | Number of boosting rounds |
freqai/prediction_models/LightGBMClassifier.pyXGBoost-based regression model for continuous value prediction.
| n_estimators | 1000 | Number of boosting rounds |
| max_depth | 6 | Maximum tree depth |
freqai/prediction_models/XGBoostRegressor.pyXGBoost-based classification model for directional prediction.
| n_estimators | 1000 | Number of boosting rounds |
freqai/prediction_models/XGBoostClassifier.pyCatBoost gradient boosting model with native categorical feature support.
| iterations | 1000 | Number of boosting iterations |
freqai/prediction_models/CatboostRegressor.pyMulti-layer perceptron neural network for regression-based price prediction.
| hidden_dim | 128 | Hidden layer dimension |
| dropout_percent | 0.2 | Dropout rate |
freqai/prediction_models/PyTorchMLPRegressor.pyLightGBM model for stock return prediction using technical and fundamental features.
| num_leaves | 31 | Maximum number of leaves |
| learning_rate | 0.1 | Boosting learning rate |
qlib/contrib/model/gbdt.pyXGBoost model for stock return prediction.
qlib/contrib/model/xgboost.pyDeep neural network for nonlinear feature extraction and return prediction.
| hidden_size | 256 | Hidden layer size |
qlib/contrib/model/pytorch_nn.pyAttention-based LSTM for sequential stock data modeling with attention mechanism.
| hidden_size | 64 | LSTM hidden size |
| num_layers | 2 | Number of LSTM layers |
qlib/contrib/model/pytorch_alstm.pyTemporal Fusion Transformer combining static and temporal features for multi-horizon prediction.
qlib/contrib/model/pytorch_tft.py