0% found this document useful (0 votes)
16 views4 pages

Logistic Regression

Logistic regression is a widely used classification algorithm that predicts categorical outcomes based on training data. It focuses on binary classification, where the target variable can take on two values, typically represented as '0' and '1'. The algorithm aims to find the best separating hyperplane, which serves as the decision boundary in feature space, and can be linear or non-linear depending on the data dimensions.

Uploaded by

nasima.tamboli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Logistic Regression

Logistic regression is a widely used classification algorithm that predicts categorical outcomes based on training data. It focuses on binary classification, where the target variable can take on two values, typically represented as '0' and '1'. The algorithm aims to find the best separating hyperplane, which serves as the decision boundary in feature space, and can be linear or non-linear depending on the data dimensions.

Uploaded by

nasima.tamboli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Logistic Regression

Logistic regression is one of the most popular and one of the most widely used
algorithms today. Before jumping into the logistic regression algorithm, we need to
understand some important concepts like classification, hyperplane

Classification
In machine learning, classification is identifying which set of categories the new
observation belongs to based on the set of training data containing the observed
categories.

In classification problems, the target variable (also known as predictor variable) which is
denoted by ‘y’ has discrete values. It’s a categorical variable.

Examples of classification problem are as follows:


1.​ Classifying an email as spam or not
2.​ Classifying online transactions as fraudulent or not
3.​ Classifying different types of flowers
4.​ Classifying a tumor as cancerous or benign
5.​ Classifying an image as a cat or a dog
6.​ A person is covid positive or negative

In all the above problems, the predictor variable y can be thought of as taking on two
values either ‘0’ or ‘1’. ​

With respect to above examples, the values of the target variable could be spam or not
spam, fraudulent or not, flower of type or flower of type 2 or flower of type 3, malignant
or benign, cat or dog, positive or negative etc.

So ‘0’ may denote an image as a cat and ‘1’ may denote it as a dog. The assignment of
two classes is arbitrary.

The general intuition is that the negative class i.e. ‘0’ denotes the absence of something
and the positive class i.e. ‘1’ denotes the presence of something that we are looking for.

First we will consider the classification problems with two classes ‘0’ and ‘1’. It is also
called binary classification. All the above examples are of binary classification.

Later on we will see multiclass problems as well where the predictor variable ‘y’ may
take on values ‘0’, ’1’, ’2’, and ‘3’.
Multiclass Classification

How to develop a classification algorithm?

JAvapoint

Let’s take an example of a classification task for classifying a tumor as malignant or


benign. If the variable ‘y’ has value ‘0’ means the tumor is malignant and if it has value
‘1’ then it’s benign.

Let’s apply linear regression by trying to fit a straight line to the given data.You may get
a hypothesis which look like as follows:
https://www.excelr.com/blog/data-science/regression/understanding-logistic-regr
ession-using-r

The task of machine learning algorithm is to findthe best separating hyperplane. Also
known as the decision boundary. Let’s assume ‘N’ as the number of features. If the
value of ‘N’ is 2 then the line runs into 2-D feature space. The line need not be straight.
It could be curved as well.

Technically you can have infinite hyperplanes. If the data has 100 features then these
lines or curves will run into all those 100 dimensional feature space. It will no longer be
a line, in that case, it will be a plane. A plane which has very high dimensionality. That’s
the reason it’s named as hyperplane.

The curve is called as a non-linear hyperplane. In a 2-D feature space, the hyperplane
will look like a line or curve.

In a 3-D feature space, it will come up like a 2-D plane which could be a sheet. The
sheet could be a plane sheet or a curved sheet.

In 4-D these hyperplanes will look like 3-D volumes. It could be cuboid, parallelepiped
etc. This way there would be different shapes and interpretations. Interpreting beyond
3-D or 4-D generally would not be possible. Hence a generic word hyperplane is used
here.

You might also like