Aan de slagGa gratis aan de slag

Model performance

You're now going to evaluate the model from the previous lesson against the test-data.

Evaluating data against new, unseen data is important, as it proves the ability of the model to correctly estimate data it has never encountered before.

All necessary modules have been imported, and the data is available as X_train and y_train, and X_test and y_test respectively.

Deze oefening maakt deel uit van de cursus

Analyzing IoT Data in Python

Cursus bekijken

Oefeninstructies

  • Create a LogisticRegression model.
  • Fit the model to X_train and y_train.
  • Score the model using X_train and y_train.
  • Score the model using X_test and y_test.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create LogisticRegression model
logreg = ____()

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

# Score the model
print(logreg.____(____, ____))
print(____)
Code bewerken en uitvoeren