Skip to content

ENH: append/concatenate pipelines #793

Closed
@sitnarf

Description

@sitnarf

Describe the bug

Nested pipelines using make_pipeline raise the exception.

Steps/Code to Reproduce

from imblearn.over_sampling import SMOTE
from imblearn.pipeline import make_pipeline
from sklearn.ensemble import RandomForestClassifier

pipeline = make_pipeline(
    make_pipeline(make_pipeline(SMOTE())),
    make_pipeline(RandomForestClassifier()),
)

Expected Results

No exception is raised.

Actual Results

Exception raised: TypeError: All intermediate steps of the chain should be estimators that implement fit and transform or fit_resample. 'Pipeline(steps=[('pipeline', Pipeline(steps=[('smote', SMOTE())]))])' implements both)

Versions

System:
python: 3.8.6 (default, Sep 25 2020, 09:36:53) [GCC 10.2.0]
executable: /home/sitnarf/.virtualenvs/backend-g-pApWmb/bin/python
machine: Linux-5.8.0-43-generic-x86_64-with-glibc2.32

Python dependencies:
pip: 20.1.1
setuptools: 44.0.0
sklearn: 0.23.2
numpy: 1.19.5
scipy: 1.6.0
Cython: None
pandas: 1.2.1
matplotlib: 3.3.4
joblib: 1.0.0
threadpoolctl: 2.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions