gbnet.models.ordinal_regression
Classes
Gradient Boosting Ordinal Regression model. |
|
Functions
|
Module Contents
- class gbnet.models.ordinal_regression.GBOrd(num_classes, nrounds=None, params=None, module_type='LGBModule', min_hess=0.0)[source]
Bases:
sklearn.base.BaseEstimator,sklearn.base.ClassifierMixinGradient Boosting Ordinal Regression model.
This model combines gradient boosting with ordinal regression to predict ordered categorical outcomes. It uses either XGBoost or LightGBM as the underlying boosting engine wrapped in a PyTorch module.
- Parameters:
num_classes (int) – Number of ordinal classes to predict
nrounds (int, optional) – Number of boosting rounds. Defaults to 500 for XGBModule and 1000 for LGBModule.
params (dict, optional) – Additional parameters passed to the gradient boosting model.
module_type (str, optional) – Type of gradient boosting module to use, either “XGBModule” or “LGBModule”. Defaults to “LGBModule”.
min_hess (float, optional) – Minimum hessian value for numerical stability. Defaults to 0.0.
- Variables:
Notes
The model uses an ordinal logistic loss function to handle ordered categorical outcomes. The gradient boosting model learns a single score which is transformed into class probabilities via learned thresholds.
- score(X, y)[source]
Return the negative log likelihood score for input X and targets y.
- Parameters:
X (array-like of shape (n_samples, n_features)) – Input features.
y (array-like of shape (n_samples,)) – Target values.
- Returns:
Negative log likelihood score. Lower values indicate better fit.
- Return type:
float