Skip to content

Combiners API

kfc_procedure.core.combiner.base.BaseCombiner

Bases: ABC, BaseEstimator

Abstract base class for ensemble combination strategies.

A combiner takes a prediction matrix:

shape = (n_samples, n_models)

and produces a final aggregated prediction.

This follows the scikit-learn estimator interface.

fit abstractmethod

Fit the combiner (if required).

Parameters:

Name Type Description Default
X ndarray

Prediction matrix from base models shape = (n_samples, n_models)

required
y ndarray

True targets (required for supervised combiners like stacking or weighted mean)

None

Returns:

Type Description
self

combine abstractmethod

Combine predictions into final output.

Parameters:

Name Type Description Default
X ndarray

Prediction matrix from base models

required

Returns:

Type Description
ndarray

Final combined prediction

predict

Scikit-learn compatible prediction interface.

kfc_procedure.core.combiner.base.CombinerFactory

Bases: BaseFactory

Regression

kfc_procedure.core.combiner.regression.mean.MeanCombiner

Bases: BaseCombiner

Row-wise mean combiner for regression ensembles.

This combiner computes the arithmetic mean of base model predictions for each sample.

No training is required.

Methods:

Name Description
fit

Stateless training step (returns self).

combine

Returns mean prediction across models.

kfc_procedure.core.combiner.regression.weighted_mean.WeightedMeanCombiner

Bases: BaseCombiner

Linear regression-based weighted combiner.

Learns optimal weights for base model predictions.

Parameters:

Name Type Description Default
fit_intercept bool

Whether to fit intercept in linear model.

False

kfc_procedure.core.combiner.regression.stacking.StackingRegressorCombiner

Bases: BaseCombiner

Stacking combiner using a regression meta-model.

The meta-model learns to map base predictions to target values.

Parameters:

Name Type Description Default
meta_model estimator

Regression model used as meta-learner.

LinearRegression()

kfc_procedure.core.combiner.regression.gradientcobra.GradientCOBRACombiner

Bases: BaseCombiner

GradientCOBRA-based regression combiner.

kfc_procedure.core.combiner.regression.mixcobra.MixCOBRACombiner

Bases: BaseCombiner

MixCOBRA-based regression combiner.

Classification

kfc_procedure.core.combiner.classification.majority_vote.MajorityVoteCombiner

Bases: BaseCombiner

Hard voting ensemble combiner.

Each sample is assigned the most frequent label among base models.

kfc_procedure.core.combiner.classification.stacking.StackingClassifierCombiner

Bases: BaseCombiner

Logistic regression stacking classifier.

Learns a mapping from base predictions to final class labels.

kfc_procedure.core.combiner.classification.combined_classifier.CobraClassifierCombiner

Bases: BaseCombiner

COBRA-based classifier combiner.

Supports probability prediction via COBRA aggregation.