Sitemap
Sarvesh Khetan

Sarvesh Khetan

A deep learning enthusiast and a Masters Student at University of Maryland, College Park.

Math Behind Linear Classification

Discriminant Classifier

2 min readMay 17, 2024

--

Table of Contents :

1.Motivation
2. Solution
2.a. Simple Linear Classification
2.b.
Multiple Linear Classification
3. Code Implementation

Motivation

We already know how to solve a regression problem statement using linear regression. So the idea here is to apply the same intuition for a classification problem statement !!

Press enter or click to view image in full size

Simple Linear Classification

For better understanding let’s first build the intuition using just 2 feature datasets so that we can visualize concepts.

Press enter or click to view image in full size
Press enter or click to view image in full size

Get Sarvesh Khetan’s stories in your inbox

Join Medium for free to get updates from this writer.

Now based on the above logic we will have to devise a cost function…

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Stochastic Gradient Descent Error Plot

Now at the time of inference, you just need to substitute the point in the line equation to classify it

Press enter or click to view image in full size
Press enter or click to view image in full size

Multiple Linear Classification

Now you can just extrapolate above intuition to N feature dataset.

--

--