Practical overview
When it fits
Use Vecstack when a training workflow has first-level estimators whose outputs should become features for a second-level model.
Who it is for
- Python machine-learning developers combining outputs from multiple estimators.
- Scikit-learn users who want stacking inside a transformer or pipeline workflow.
Documented uses
- Generate stacked features for classification or regression.
- Produce class-label or probability predictions for classification.
- Add multilevel stacking to a scikit-learn pipeline.
- Save stacked features and run hyperparameters to files through the functional API.
Requirements & limits
- The package documents Python 3.9 or later and dependencies on NumPy, SciPy and scikit-learn 1.6.0 or later.
- Its two APIs differ in integration style: the functional API returns stacked features directly, while the transformer exposes
fitandtransform. - Classification supports class labels or probabilities, and the package also documents regression.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Add stacked features with the functional API
Generate stacked training and test features from first-level estimators for a regression workflow.
Before you start
- Python 3.9 or later.
- NumPy, SciPy and scikit-learn 1.6.0 or later.
- Training and test inputs, training targets, and initialized sklearn-like estimators.
Steps
Install the package with the command below.
pip install vecstackImport
stackingfromvecstackand prepare a list of first-level estimators.Call
stacking(models, X_train, y_train, X_test, regression=True)to obtainS_trainandS_test.Pass the stacked features to a second-level estimator.
Expected outcome
Stacked training and test features ready for a second-level estimator.
Guide limitations
- The example assumes the user's data and estimators are already prepared.
- The README's usage example does not specify a second-level estimator or its training procedure.
Use the scikit-learn transformer API
Create stacked features through Vecstack's `fit` and `transform` interface.
Before you start
- Python 3.9 or later.
- NumPy, SciPy and scikit-learn 1.6.0 or later.
- Training and test inputs, training targets, and named first-level estimators.
Steps
Install the package with the command below.
pip install vecstackImport
StackingTransformerand initialize it with named estimators and the task setting.Fit the transformer using
X_trainandy_train.Call
transformon the training and test inputs to obtain stacked features.Use those features with a second-level estimator.
Expected outcome
A fitted transformer produces stacked feature arrays and can be incorporated into a scikit-learn pipeline.
Guide limitations
- The documented example leaves data preparation and the second-level estimator to the user.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 7 November 2026
- Original website title
- vecxoz/vecstack · Official homepage title · retained in its source language

