Skip to content

Main API

kfc_procedure.KFCProcedure

Bases: BaseEstimator

Full KFC pipeline estimator (sklearn-compatible).

This estimator implements the complete KFCProcedure framework:

K-step → F-step → C-step

It performs divergence-aware clustering, cluster-wise local model fitting, and final ensemble aggregation.

Parameters:

Name Type Description Default
divergences list

List of Bregman divergences used in K-step clustering. Can include strings or BaseBregmanDivergence instances.

required
local_model str or BaseLocalModel

Base learner used in F-step for cluster-wise modeling.

required
combiner str or BaseCombiner

Aggregation strategy used in C-step.

required
divergences_params dict

Optional parameters for each divergence.

None
local_model_params dict

Parameters for local models in F-step.

None
combiner_params dict

Parameters for aggregation strategy in C-step.

None
task ('regression', 'classification')

Learning task type.

"regression"
n_clusters int

Number of clusters per divergence.

3
max_iter int

Maximum iterations for KMeans optimization.

300
tol float

Convergence tolerance for clustering.

1e-4
verbose int

Enable debugging output. Levels: 0 - silent 1 - basic info 2 - detailed debug 3 - trace (per-iteration / per-cluster)

0
random_state int or None

Random seed for reproducibility.

None

Attributes:

Name Type Description
kstep_ KStep

Fitted divergence-aware clustering stage.

fstep_ FStep

Fitted local model learning stage.

cstep_ CStep

Fitted aggregation stage.

Methods:

Name Description
fit

Fit full KFC pipeline.

predict

Predict using full pipeline.

predict_proba

Predict probabilities (classification only).

Notes

The training procedure uses a train/test split internally:

- K-step + F-step trained on training split
- C-step trained on held-out predictions

This reduces overfitting in the aggregation stage and improves generalization of the ensemble combiner.

kfc_procedure.KFCRegressor

Bases: KFCProcedure

kfc_procedure.KFCClassifier

Bases: KFCProcedure