LightGBM model

1. Node overview

LightGBM (Light Gradient Boosting Machine) is a high-performance gradient-boosting framework developed by Microsoft. It uses histogram-based algorithms and leaf-wise tree growth to accelerate training while maintaining high accuracy. The LightGBM model node trains on factor data from the data-processing node and outputs predictions for the strategy node.

Position in the data flow
Data sourceData processingAI modelStrategy typePosition managementRisk controlTrading engine
✓ Strengths

Fast training and inference

Low memory consumption

Interpretable feature importance

Supports categorical features and is robust to missing values

Use cases

Multi-factor cryptocurrency or equity selection

Rapid strategy validation

Factor screening and importance analysis

Cross-sectional ranking predictions

⚠ Limitations

Limited time-series modelling capability

Requires manual feature engineering

Does not capture long-term temporal patterns well

2. Interactive configuration

The panel below is the actual LightGBM model node configuration. Use it to explore every setting: prediction column name, task type, and parameter configuration mode (adaptive or advanced).

LightGBM model configuration

Only A-Z, a-z, 0-9, - and _ are supported; other characters are replaced with _.

Name of the model prediction output column.

2.1 Prediction column name

Set the name of the column that stores model predictions
What is the prediction column name?
After training, the model adds a column containing its predictions. A downstream strategy node references model output through this name. The default is pred.
Tip: when a workflow contains several AI model nodes, assign each one a different prediction column, such as pred_lgb and pred_lstm, so the strategy can distinguish them.

2.2 Task type

Select the model's training objective and loss function
What is a task type?
The task type determines how the model learns and how it produces predictions. Different task types use different loss functions, so choosing the appropriate task is essential to model performance. The system supports Ranking, Binary, and Regression. LightGBM, LSTM, and Transformer default to Binary; switch explicitly to Ranking only for cross-sectional selection across multiple instruments.
⚡ Quick selection guide
DimensionRankingBinary ⭐Regression
Primary objectiveLearn relative orderClassify upward or downward directionPredict an exact return
Noise robustness⭐⭐⭐⭐⭐⭐⭐⭐⭐
Generalization⭐⭐⭐⭐⭐⭐⭐⭐⭐
Sensitivity to outliersMediumLow (inherently resistant)High
Fit for cryptocurrencyMulti-asset selectionBest for single-asset timingPosition-management support
Typical strategyLong/short hedge or ranked selectionTrend timing or enhanced gridDynamic positions or risk control
Recommendation: cryptocurrency markets are highly volatile and contain many extreme moves. Binary classification collapses continuous returns into direction, naturally filtering tail noise. Directional accuracy matters more than return-magnitude precision, so Binary is the default recommendation.

2.2.1 Ranking

Learn relative order among samples; suitable for multi-factor asset selection

Ranking does not optimize the absolute prediction value. It learns relative order among samples, placing higher-return samples ahead of lower-return samples. In multi-asset cryptocurrency strategies, it can select the instruments with the greatest upside potential from dozens of pairs and is the primary driver of cross-sectional selection strategies.

PropertyDescription
Label requirementA continuous value such as return: shift(close, -5) / shift(open, -1) - 1
Output rangeAny real number; a larger score ranks higher
Use casesMulti-factor selection, cross-sectional ranking, and long/short hedging
Frontend fieldtaskType: "ranking"
Ranking mode (rankingMode)

Selecting Ranking reveals the ranking-mode option, which determines where optimization is concentrated:

Balanced (balanced)
Optimize both the head and tail
Long/short hedging
Head (head)
Prioritize the top-ranked samples
Long-only strategies
Tail (tail)
Prioritize the bottom-ranked samples
Short-only strategies
💡 Cryptocurrency note: Ranking requires cross-sectional data for several trading pairs, such as BTC, ETH, and SOL features at the same time. The model compares their relative strength within each time slice. For a single instrument, choose Binary instead.

2.2.2 Binary ⭐ Recommended

Predict upward or downward direction; the first choice for cryptocurrency timing

Binary classification turns forecasting into an up-or-down decision. The model outputs signed confidence with a theoretical range of -1 to 1: positive is bullish, negative is bearish, and a greater absolute value means higher confidence. Because cryptocurrency has high volatility and a low signal-to-noise ratio, actual predictions usually cluster around -0.1 to 0.1; theoretical values near ±1 are almost never seen. Begin machine-learning models with entry thresholds around 0.03 / -0.03, inspect the prediction distribution after the first backtest, and recalibrate. Do not start from theoretical thresholds such as 0.2 or 0.5, which may trigger extremely rarely or never. Direction still has a much better signal-to-noise ratio than magnitude, making Binary the most practical task.

PropertyDescription
Label requirementA Boolean value or continuous return; continuous values are converted to 0/1 using > 0
Output rangeTheoretical -1 to 1 confidence; generally -0.1 to 0.1 in practice because financial signal-to-noise is low
Use casesDirection forecasting, timing signals, and trend classification
Frontend fieldtaskType: "binary" (system default)
Label example: label = shift(close, -5) / shift(open, -1) - 1 means buying at the next candlestick's open and selling five periods later. The engine converts returns > 0 to positive class 1 and returns ≤ 0 to negative class 0.
📊 Confidence-to-probability table

Binary output is signed confidence in the range -1 to 1: confidence = 2 × probability - 1.

Probability30%40%50%55%60%
Confidence-0.4-0.200.10.2

Strategy example: pred > 0.2 opens a long position (60% bullish probability), while pred < -0.2 closes it (only 40% bullish probability).

🎯 Why is Binary recommended for cryptocurrency?
Compressed label space: continuous returns collapse to {0, 1}, so extreme ±20% moves no longer dominate the loss.
Direction over magnitude: getting direction right can be profitable in a volatile market without predicting the exact return.
Natural regularization: a classification boundary is smoother than a regression fit and is less likely to overfit isolated abnormal candles.
Actionable confidence: probabilities can directly represent signal strength for dynamic position sizing.

2.2.3 Regression

Predict an exact return and optimize absolute accuracy

Regression requires the model to predict an exact return value. Unlike Ranking, it minimizes the absolute error between prediction and target. Frequent extreme cryptocurrency moves, such as flash crashes and sudden rallies, can dominate regression training, so generalization is often weaker than Binary. The output nevertheless has a clear physical meaning and is useful as an auxiliary signal for position sizing and risk control.

PropertyDescription
Label requirementA continuous return such as shift(close, -5) / shift(open, -1) - 1
Output rangeAny real number representing predicted return
Use casesPosition sizing, risk assessment, and expected-return calibration
Frontend fieldtaskType: "regression"
✓ Advantage: the output has a clear physical meaning and can be used directly for position calculations and expected-return assessments.

2.3 Parameter configuration mode

Choose system-adaptive or manually configured parameters
What is parameter configuration mode?
The system provides Adaptive mode, which tunes parameters from the data size, and Advanced parameter configuration, which exposes every model parameter. Adaptive mode is the default and is suitable for new users and rapid strategy validation.

2.3.1 Adaptive mode

The system chooses parameters automatically from the data size

The system calculates model parameters from the number of training samples and features. This is suitable for new users and rapid strategy validation and does not require detailed knowledge of LightGBM model parameters.

✓ Advantages

No tuning experience required

Start training quickly

Lower overfitting risk

⚠ Limitations

No fine-grained model control

Parameters may not be optimal

Adaptive parameter ranges
The system selects parameters within these ranges: learning rate 0.03–0.07, maximum depth 4–8, 18–30 leaves, 38–90 minimum samples per child, and 120–280 boosting rounds.

2.3.2 Advanced parameter configuration

Configure every parameter manually for fine-grained tuning

Advanced mode displays the full panel in three parts: model architecture, training parameters, and regularization. It is intended for experienced users performing detailed tuning.

2.3.2.1 Model architecture

These parameters control decision-tree complexity. Deeper trees and more leaves create a more complex model, but also increase the risk of overfitting. Leave a field blank to let the system calculate it adaptively.

ParameterAllowed rangeAdaptive rangeDescription
Maximum depth1–154–8Maximum depth of each tree
Number of leaves8–25618–30Maximum number of leaves in each tree
Minimum samples per child5–200038–90Minimum number of samples required in a leaf
Small dataset (<100,000): maxDepth: 3–5, numLeaves: 8–16
Large dataset (>1,000,000): maxDepth: 6–10, numLeaves: 32–64
2.3.2.2 Training parameters

These parameters control model training. A smaller learning rate requires more boosting rounds, but usually produces better results.

ParameterDefaultAllowed rangeDescription
Boosting roundsAdaptive1–1000Number of boosting iterations
Learning rateAdaptive0.001–0.5Weight assigned to each tree
Validation split0.20–0.5Used for early stopping; 0 disables validation
Early-stopping patience101–100Stop after N rounds without improvement
Early stopping: training stops automatically when the validation metric has not improved for the configured number of rounds, preventing overfitting.
2.3.2.3 Regularization

Regularization prevents overfitting. Higher dropout applies stronger regularization and produces a simpler model. Leave a field blank to let the system calculate it adaptively.

ParameterAllowed rangeAdaptive rangeDescription
Sample dropout0–0.50.10–0.25Proportion of data sampled out at random
Feature dropout0–0.50.10–0.25Proportion of features sampled out at random
Overfitting: good training but poor validation → increase dropout
Underfitting: both poor → reduce dropout or enlarge the model

3. Output data structure

The LightGBM model node adds a prediction column to its input data and returns the following structure:

ColumnTypeSourceDescription
datetimedatetimePassed throughTimestamp
symbolstringPassed throughTrading pair
open/high/low/close/volumefloatPassed throughRaw OHLCV data
[factor columns…]floatPassed throughFactors calculated by the data-processing node
predfloatAddedModel prediction; the name is controlled by predictionColumn
Meaning of predictions by task type
Ranking
Ranking score; a larger value ranks higher
Relative selection
Binary
Bullish confidence in the range -1 to 1
Direction
Regression
Predicted return, which may be positive or negative
Return forecast

4. FAQ

Q: How should I choose between adaptive and advanced mode?
A: Use adaptive mode when getting started or validating a strategy quickly; the system selects suitable parameters from the data size. Switch to advanced parameter configuration when you need fine-grained tuning or have explicit parameter targets.
Q: What is the difference between Ranking and Regression?
A: Ranking optimizes the relative order among samples and is suitable for multi-factor asset selection, where the objective is to identify the best instruments. Regression optimizes the absolute accuracy of predicted values and is suitable when an exact return forecast is needed. Ranking is generally recommended for asset-selection strategies.
Q: How many boosting rounds should I use?
A: Set a relatively large epochs value, such as 200–500, together with earlyStopPatience around 20–30. Training stops automatically when the validation metric no longer improves, helping prevent overfitting.
Q: How can I tell whether the model is overfitting?
A: Compare training and validation metrics in the training logs. Strong training performance with poor validation performance indicates overfitting. Increase sampleDropout and featureDropout, reduce maxDepth or numLeaves, increase minChildSamples, or add more training data.
Q: Can I customize the prediction column name?
A: Yes. Set predictionColumn; the default is pred. Downstream strategy nodes can reference the model output through this column name.
    BeeQuant - AI Quantitative Trading Platform