StackedPredictor¶
Learn a binary meta-predictor from out-of-fold predictions of several distinct base methods.
This node complements MethodEnsemblePredictor: whereas the fixed-rule ensemble combines final predictions using a static rule such as a mean or vote, this node first generates out-of-sample predictions for each wrapped method using an internal cross-validation, then fits a second-stage meta-model that learns how to combine those method-specific probabilities. The default Bayesian option uses a log-opinion pool with simplex-constrained weights, while the legacy logistic option remains available as a backward-compatible fallback. The node is intended as a narrow first version of stacking for binary classification on segmented packets with an instance axis. Each wired method should therefore emit class probabilities that can be interpreted as binary probabilities. Once trained, the node fits each base method once on the full dataset and uses those full-data models together with the learned meta-model for later predictions on new data. Version 0.7.0
Ports/Properties¶
data¶
Data to process.
method1¶
Base method 1.
method1__signature¶
Argument names of the first base method. Each method should generally start with a Placeholder named data and end in a probabilistic classifier or wrapper that emits binary class probabilities. Optional placeholders such as is_training, random_seed, and index may also be exposed.
method2¶
Base method 2.
method2__signature¶
Signature for the "method2" input. This represents the signature for the subgraph that is wired into the "method2" port. This is formatted as in (a,b,c) where a,b,c are names of placeholders that are expected in the subgraph that goes into the "method2" port. Alternatively, it can also be provided in data structure form as a list of lists, as in: [['a','b','c']].
method3¶
Base method 3.
method3__signature¶
Signature for the "method3" input. This represents the signature for the subgraph that is wired into the "method3" port. This is formatted as in (a,b,c) where a,b,c are names of placeholders that are expected in the subgraph that goes into the "method3" port. Alternatively, it can also be provided in data structure form as a list of lists, as in: [['a','b','c']].
method4¶
Base method 4.
method4__signature¶
Signature for the "method4" input. This represents the signature for the subgraph that is wired into the "method4" port. This is formatted as in (a,b,c) where a,b,c are names of placeholders that are expected in the subgraph that goes into the "method4" port. Alternatively, it can also be provided in data structure form as a list of lists, as in: [['a','b','c']].
method5¶
Base method 5.
method5__signature¶
Signature for the "method5" input. This represents the signature for the subgraph that is wired into the "method5" port. This is formatted as in (a,b,c) where a,b,c are names of placeholders that are expected in the subgraph that goes into the "method5" port. Alternatively, it can also be provided in data structure form as a list of lists, as in: [['a','b','c']].
enabled¶
Whether to enable stacking. If disabled, only the first wired method is used and the learned meta-model is bypassed.
meta_model¶
Meta-model used to combine out-of-fold base predictions. 'bayesian' (default) uses a log-opinion pool with non-negative simplex weights and a symmetric Dirichlet prior fit by NumPyro NUTS. 'logistic' uses the legacy L2-regularized sklearn LogisticRegression stacker.
regularization_strength¶
Inverse regularization strength C of the logistic meta-model. Higher values weaken the regularization, while lower values shrink the learned combination weights more strongly. Only used when meta_model='logistic'.
fit_intercept¶
Whether to fit an intercept term in the logistic meta-model. Only used when meta_model='logistic'.
dirichlet_concentration¶
Concentration parameter of the symmetric Dirichlet prior on the simplex weights of the Bayesian meta-model. Values above 1 shrink toward uniform weighting; values below 1 encourage sparse corner solutions. Only used when meta_model='bayesian'.
meta_logit_clip¶
Clipping bound applied to method probabilities before logit transformation in the Bayesian meta-model. Tighter clipping caps the veto effect from overconfident component methods. Only used when meta_model='bayesian'.
cond_field¶
Name of the instance-axis field that contains the class labels used to fit the stacker.
num_folds¶
Number of internal cross-validation folds used to generate out-of-fold base predictions for the stacker.
cv_group_field¶
Optional grouping field for the internal cross-validation. If given, validation folds contain unseen groups such as sessions or subjects.
stratified¶
Whether to stratify the internal cross-validation by class label where supported.
randomized¶
Whether to randomize the internal cross-validation where supported by the chosen fold scheme.
repeats¶
Number of repeated randomized CV runs used to generate out-of-fold predictions. Repeated predictions for a given instance are averaged before fitting the meta-model.
censor_labels¶
Whether to clear the labels from each validation split before applying the base methods. This can help avoid accidental leakage in pipelines that inspect labels at prediction time.
num_warmup¶
Number of NUTS warmup (burn-in) steps used for the Bayesian meta-model. Only used when meta_model='bayesian'.
num_mcmc_samples¶
Number of NUTS posterior samples drawn per chain for the Bayesian meta-model. Only used when meta_model='bayesian'.
num_chains¶
Number of independent NUTS chains for the Bayesian meta-model. Multiple chains enable between-chain R-hat convergence diagnostics, which are more reliable than single-chain split R-hat. Chains are run sequentially to avoid conflicts with any outer multiprocessing in the training pipeline. Only used when meta_model='bayesian'.
initialize_once¶
Calibrate the wrapped methods and the meta-model only once. If set to False, the stacker is retrained whenever a labeled non-streaming dataset is received.
dont_reset_model¶
Do not reset the wrapped methods when the preceding graph is changed.
random_seed¶
Seed for the internal cross-validation and for wrapped methods that accept a random_seed placeholder. This can either be a splittable seed or a plain integer.
verbosity¶
Verbosity level for diagnostics.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.