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

Build a classification model

While eye-balling differences is a useful way to gain an intuition for the data, let's see if you can operationalize things with a model. In this exercise, you will use each repetition as a datapoint, and each moment in time as a feature to fit a classifier that attempts to predict abnormal vs. normal heartbeats using only the raw data.

We've split the two DataFrames (normal and abnormal) into X_train, X_test, y_train, and y_test.

Bu egzersiz

Machine Learning for Time Series Data in Python

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

Egzersiz talimatları

  • Create an instance of the Linear SVC model and fit the model using the training data.
  • Use the testing data to generate predictions with the model.
  • Score the model using the provided code.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

from sklearn.svm import LinearSVC

# Initialize and fit the model
model = ____
model.____

# Generate predictions and score them manually
predictions = model.____
print(sum(predictions == y_test.squeeze()) / len(y_test))
Kodu Düzenle ve Çalıştır