Skip to content
CampusEduX

Problem 3: Evaluate Predictions Against Actual Labels

Easypython
Learn the Concept: Logistic Regression

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.

Related Problems

  • Problem 1: Train a Basic Logistic Regression Classifier
    Easy · python
    Solve Problem
  • Problem 2: Predict Probabilities
    Easy · python
    Solve Problem
  • Problem 4: Apply a Custom Decision Threshold
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...