Skip to main content

HistGradientBoostingClassifier

#include <Skigen/Ensemble>

template <typename Scalar = double>
class Skigen::HistGradientBoostingClassifier(loss=Loss::LogLoss, learning_rate=0.1, max_iter=100, max_leaf_nodes=31, max_depth=std::nullopt, min_samples_leaf=20, l2_regularization=0, max_bins=255, monotonic_cst=std::nullopt, categorical_features=std::nullopt, early_stopping=false, validation_fraction=0.1, n_iter_no_change=10, tol=1e-7, random_state=std::nullopt)

Histogram-based Gradient Boosting for classification.

Bins each feature into at most max_bins quantile-based buckets, then runs stage-wise additive gradient boosting on the binned representation with a native gradient/hessian histogram split finder. Binary problems boost a single log-odds score; multiclass problems boost one tree per class per iteration against the softmax cross-entropy gradient.

Mirrors sklearn.ensemble.HistGradientBoostingClassifier for the log-loss case.



Attributes:

  • loss : Loss

  • learning_rate : Scalar

  • max_iter : int

  • max_bins : int

  • init : VectorType Per-class init scores (length 1 for binary, n_classes otherwise).

  • classes : const Eigen::VectorXi

  • n_classes : int

  • n_iter : int

  • bin_edges : const std::vector< std::vector< Scalar > > &

  • train_score : VectorType


Methods

SKIGEN_PARAMS()


fit(X, y)

Fit natively from a sparse design matrix without densifying.

The sparse input is binned directly into the compact uint8 histogram representation; no dense double n×pn\times p matrix is built.


fit_from_binned(X_binned, y)


predict(X)


decision_function(X)

Raw additive scores. Shape (n_samples,) for binary (log-odds), (n_samples, n_classes) for multiclass.


predict(X)

Predicted class labels from a sparse design matrix.


predict_proba(X)

Probability estimates from a sparse design matrix.


predict_proba(X)

Probability estimates, shape (n_samples, n_classes).


fit(X, y)


predict(X)