Model predictions
You're ready to use your model to predict values based on the test dataset, and inspect the results!
All necessary modules have been imported and the data is available as X_train, y_train, and X_test. Don't hesitate to refer to the slides if you don't remember how to initialize a Pipeline.
この演習はコースの一部です
Analyzing IoT Data in Python
演習の手順
- Create a Pipeline as before, using a
StandardScalerand aLogisticRegression, and name the steps"scale"and"logreg"respectively. - Fit the Pipeline to
X_trainandy_train. - Predict classes for
X_testand store the result aspredictions. - Print the resulting array.
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Create Pipeline
pl = Pipeline([
(____, ____),
____
])
# Fit the pipeline
____.____(____, ____)
# Predict classes
____ = ____.____(____)
# Print results
print(____)