Skip to main content

CalibratedClassifierCV

#include <Skigen/Calibration>

template <typename Base, typename Scalar = double>
class Skigen::CalibratedClassifierCV(estimator, method=`CalibrationMethod::Sigmoid`, cv=5, n_jobs=1, ensemble=true, random_state=std::nullopt)

Probability calibration for a base classifier via cross-validation.

Mirrors the binary case of sklearn.calibration.CalibratedClassifierCV for an estimator that exposes predict_proba(X) returning a matrix of shape (n_samples, 2).

Splits the training set into cv folds. For each fold the base classifier is cloned, fit on the train portion, and applied to the validation portion to produce raw positive-class probabilities; a calibrator (sigmoid or isotonic) is then fit on (p_raw, y) for that fold. At prediction time, all cv (base, calibrator) pairs are applied and their calibrated probabilities are averaged (ensemble=true, the sklearn 1.7 default).



Attributes:

  • method : CalibrationMethod

  • cv : int

  • ensemble : bool

  • classes : const Eigen::VectorXi

  • n_classes : int

  • n_estimators_fitted : int

  • folds : const std::vector< FoldFit > &


Methods

SKIGEN_PARAMS()


predict(X)


predict_proba(X)

Return averaged calibrated class probabilities, shape (n_samples, 2).