Summary
The underlying LightGBM C++ framework natively supports quantile regression via the parameters objective="quantile" and alpha=<float> (where alpha is the target quantile, e.g., 0.05 for the 5th percentile). However, the ML.NET LightGbmRegressionTrainer wrapper currently hardcodes objective="regression" in LightGbmRegressionTrainer.cs and does not expose the alpha parameter, making it impossible to train quantile regression models through the ML.NET API.
Motivation
Quantile regression is widely used for:
- Prediction intervals: Training two models (e.g., α=0.05 and α=0.95) to obtain a 90% prediction interval
- Risk modeling: Predicting worst/best-case scenarios
- Heteroscedastic data: Where variance changes across the feature space
Since the native LightGBM library already supports this, exposing it through ML.NET would be a high-value, low-risk enhancement.
Proposed Changes
- Add a
RegressionObjective enum to LightGbmRegressionTrainer.Options with values Regression (default) and Quantile
- Add an
Alpha property (double, default 0.5) to LightGbmRegressionTrainer.Options
- Modify
CheckAndUpdateParametersBeforeTraining to conditionally set objective=quantile and alpha=<value>
- Validate that
Alpha ∈ (0, 1)
- Add unit tests
API Usage
var options = new LightGbmRegressionTrainer.Options
{
Objective = LightGbmRegressionTrainer.Options.RegressionObjective.Quantile,
Alpha = 0.95,
};
var trainer = mlContext.Regression.Trainers.LightGbm(options);
Scope
- No new trainer class, quantile regression produces identical tree structures and output schema
- No changes to model serialization, ONNX export, or catalog extension methods
Summary
The underlying LightGBM C++ framework natively supports quantile regression via the parameters
objective="quantile"andalpha=<float>(where alpha is the target quantile, e.g., 0.05 for the 5th percentile). However, the ML.NETLightGbmRegressionTrainerwrapper currently hardcodesobjective="regression"in LightGbmRegressionTrainer.cs and does not expose thealphaparameter, making it impossible to train quantile regression models through the ML.NET API.Motivation
Quantile regression is widely used for:
Since the native LightGBM library already supports this, exposing it through ML.NET would be a high-value, low-risk enhancement.
Proposed Changes
RegressionObjectiveenum toLightGbmRegressionTrainer.Optionswith valuesRegression(default) andQuantileAlphaproperty (double, default 0.5) toLightGbmRegressionTrainer.OptionsCheckAndUpdateParametersBeforeTrainingto conditionally setobjective=quantileandalpha=<value>Alpha∈ (0, 1)API Usage
Scope