0% found this document useful (0 votes)
124 views

Lab Assignment-3 Logistic Regression

The document provides instructions for a machine learning lab assignment on logistic regression. Students are asked to build a binary classifier for classifying emails as spam or ham using a training dataset. They also need to apply logistic regression on a heart disease dataset, showing all pre-processing steps.

Uploaded by

adityasingh.b9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views

Lab Assignment-3 Logistic Regression

The document provides instructions for a machine learning lab assignment on logistic regression. Students are asked to build a binary classifier for classifying emails as spam or ham using a training dataset. They also need to apply logistic regression on a heart disease dataset, showing all pre-processing steps.

Uploaded by

adityasingh.b9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

School of Computer Science and Engineering, VIT Chennai.

BCSE209P Machine Learning


Lab-3 Logistic Regression
Faculty : Dr. R. Jothi
Due Date : 23/01/2024

Submit your python code (Jupyter notebook): with output for all the questions.

Q1. Design a binary classifier for classifying the following emails as spam (1)
or ham (0). Use email.csv for training. Each column xi in the csv file represents
certain keyword used for spam prediction. The first column x0 is a bias. If xi =1
means, keyword xi is present in the email.
 Print all the parameter values learnt after training
 Show the accuracy on the test set.
Test emails
Assume first four are spam and the last four are not spam.

𝒙𝟏 = 𝟎 𝒙𝟐 = 𝟏 𝒙𝟑 = 0 𝒙𝟒 = 0 𝒙𝟓 = 0

𝒙𝟏 = 𝟏 𝒙𝟐 = 𝟏 𝒙𝟑 = 1 𝒙𝟒 = 0 𝒙𝟓 = 1

𝒙𝟏 = 𝟎 𝒙𝟐 = 𝟏 𝒙𝟑 = 1 𝒙𝟒 = 0 𝒙𝟓 = 0

𝒙𝟏 = 𝟏 𝒙𝟐 = 𝟎 𝒙𝟑 = 1 𝒙𝟒 = 0 𝒙𝟓 = 0

𝒙𝟏 = 𝟎 𝒙𝟐 = 𝟏 𝒙𝟑 = 0 𝒙𝟒 = 0 𝒙𝟓 = 1

𝒙𝟏 = 𝟎 𝒙𝟐 = 𝟎 𝒙𝟑 = 0 𝒙𝟒 = 1 𝒙𝟓 = 1

𝒙𝟏 = 𝟎 𝒙𝟐 = 𝟏 𝒙𝟑 = 0 𝒙𝟒 = 1 𝒙𝟓 = 1

𝒙𝟏 = 𝟎 𝒙𝟐 = 𝟎 𝒙𝟑 = 0 𝒙𝟒 = 0 𝒙𝟓 = 1

Q2. Use appropriate Scikit Library function to apply logistic regression on the
same dataset and compare the results with your implementation.
Q3. Also use logistic regression model to predict the risk of having heart disease
using the given dataset (heart.csv).
You need to show complete pre-processing steps (identifying null or missing
values, normalization, etc.)

You might also like