BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Analyzing IoT Data in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import LogisticRegression from sklearn.linear_model.
  • Initialize the model as logreg.
  • Fit the model to X_train with the labels y_train.
  • Predict some classes using X_test.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import LogisticRegression
from ____ import ____

# Initialize the model
logreg = ____

# Fit the model
____.____(____, ____)

# Predict classes
print(____.____(____))
Kodu Düzenle ve Çalıştır