Logistic Regression
Using the data from the previous exercise, you'll now train a Machine learning model.
In line with best practices, the data is now available as X_train, while the labels have been loaded as y_train.
A subset of the data is also available as X_test. You'll learn later in this chapter how to properly create these variables.
この演習はコースの一部です
Analyzing IoT Data in Python
演習の手順
- Import
LogisticRegressionfromsklearn.linear_model. - Initialize the model as
logreg. - Fit the model to
X_trainwith the labelsy_train. - Predict some classes using
X_test.
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Import LogisticRegression
from ____ import ____
# Initialize the model
logreg = ____
# Fit the model
____.____(____, ____)
# Predict classes
print(____.____(____))