Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Pipeline | Pipelines
course content

Зміст курсу

ML Introduction with scikit-learn

PipelinePipeline

Now that you know how to transform columns separately using the make_column_transformer function, you are well-equipped to create pipelines!
As a reminder, a pipeline is a container for your preprocessing steps, that can apply them sequentially.

To create a pipeline using Scikit-learn, you can either use a Pipeline class constructor or a make_pipeline function, both from the sklearn.pipeline module.
In this course, we will focus on the second approach since it is easier to use.

You just need to pass all the transformers as arguments to a function. Creating pipelines is that simple.
However, when you call the .fit_transform(X) method on the Pipeline object, it applies .fit_transform(X) to every transformer inside the pipeline, so if you want to treat some columns differently, then you should use a ColumnTransformer and pass it to make_pipeline().

Let's code! We will use the same file as in the previous chapter.
We want to build a pipeline containing encoders for categorical features and SimpleImputer. There are both nominal and ordinal, so we need to use a ColumnTransformer to encode them separately. We have already done it in the previous chapter.

Все було зрозуміло?

Секція 3. Розділ 3
course content

Зміст курсу

ML Introduction with scikit-learn

PipelinePipeline

Now that you know how to transform columns separately using the make_column_transformer function, you are well-equipped to create pipelines!
As a reminder, a pipeline is a container for your preprocessing steps, that can apply them sequentially.

To create a pipeline using Scikit-learn, you can either use a Pipeline class constructor or a make_pipeline function, both from the sklearn.pipeline module.
In this course, we will focus on the second approach since it is easier to use.

You just need to pass all the transformers as arguments to a function. Creating pipelines is that simple.
However, when you call the .fit_transform(X) method on the Pipeline object, it applies .fit_transform(X) to every transformer inside the pipeline, so if you want to treat some columns differently, then you should use a ColumnTransformer and pass it to make_pipeline().

Let's code! We will use the same file as in the previous chapter.
We want to build a pipeline containing encoders for categorical features and SimpleImputer. There are both nominal and ordinal, so we need to use a ColumnTransformer to encode them separately. We have already done it in the previous chapter.

Все було зрозуміло?

Секція 3. Розділ 3
some-alt