Skip to content
C

Problem 3: Evaluate Predictions Against Actual Labels

Easypython

Problem Description

Write a Python program that trains a Logistic Regression model, makes predictions on a small test set, and manually calculates the accuracy (percentage of correct predictions) without using any built-in accuracy function.

Input

Training data and a small labeled test set.

Output

The manually calculated accuracy.

Constraints

  • Test set will have at least 4 examples.

Example Input

text
X_test=[[2],[4],[6],[8]], y_test=[0,0,1,1]

Example Output

text
Accuracy: 0.75

Concepts Covered

.predict(), manual accuracy calculation, loops.

Input (stdin)

Output

Run your code to see output here...