LoslegenKostenlos loslegen

Creating Pipelines

You'll now use one of the best features scikit-learn has to offer, Pipelines. Pipelines allow you to chain multiple actions, like transformations and estimations, which are applied sequentially to new data.

You'll now create a pipeline containing both a StandardScaler and a LogisticRegression estimator.

This allows you to pass unscaled data to the pipeline, where the Scaler will scale the data, and the LogisticRegression will predict the target column.

The unscaled data is available as X_train, while the labels have been loaded as y_train. A subset of the data, X_test , is also available to evaluate the model.

StandardScaler and LogisticRegression have been imported for you.

Diese Übung ist Teil des Kurses

Analyzing IoT Data in Python

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Import pipeline
from ____ import ____

# Create Scaler and Regression objects
sc = ____()
logreg = ____
Code bearbeiten und ausführen