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

Unit 2 Linear and Logistic Regression

The document discusses linear regression, a fundamental predictive analysis technique that relates independent and dependent variables, and outlines its types, including simple, multiple, logistic, ordinal, and multinomial regression. It provides the formula for linear regression and explains logistic regression as a supervised learning algorithm used for classification tasks, employing the sigmoid function to predict probabilities. Key points highlight the nature of logistic regression outputs as categorical and the use of a threshold value to determine classifications.

Uploaded by

Deepanshu Tyagi
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)
5 views

Unit 2 Linear and Logistic Regression

The document discusses linear regression, a fundamental predictive analysis technique that relates independent and dependent variables, and outlines its types, including simple, multiple, logistic, ordinal, and multinomial regression. It provides the formula for linear regression and explains logistic regression as a supervised learning algorithm used for classification tasks, employing the sigmoid function to predict probabilities. Key points highlight the nature of logistic regression outputs as categorical and the use of a threshold value to determine classifications.

Uploaded by

Deepanshu Tyagi
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/ 23

Machine Learning Techniques

(BCS-055)
Unit 2: Linear Regression

Dr. Sushil Kumar


Associate Professor, CSE Department
Linear Regression
• Linear regression is the most basic and commonly used
predictive analysis.
• One variable is considered to be an explanatory
variable (Independent Variable), and the other is
considered to be a dependent variable.
• For example, a modeler might want to relate the
weights of individuals to their heights using a linear
regression model.
Types of linear regression
• Simple linear regression
• One dependent variable (interval or ratio)
• One independent variable (interval or ratio)
• Multiple linear regression
• One dependent variable (interval or ratio)
• Two or more independent variables (interval or ratio)
• Logistic regression
• One dependent variable (binary)
• Two or more independent variable(s) (interval or ratio)
• Ordinal regression
• One dependent variable (ordinal)
• One or more independent variable(s) (nominal)
• Multinomial regression
• One dependent variable (nominal)
• One or more independent variable(s) (interval or ratio)
Formula for linear regression
• Formula for linear regression equation is given by:
y=a+bx
a and b are given by the following formulas:

Where,
x and y are two variables on the regression line.
b = Slope of the line.
a = y-intercept of the line.
x = Values of the first data set.
y = Values of the second data set.
Question
Find linear regression equation for the following two sets of data:

Predict the output Y for the input x=12


Solution

• a=1.5, b=.95
• For x=12, Y=??
Logistic Regression
• It is a supervised machine learning algorithm used
for classification tasks where the goal is to predict the
probability that an instance belongs to a given class or not.
• It is a statistical algorithm which analyze the relationship
between two data factors.
• It uses sigmoid function, that takes input as independent
variables and produces a probability value between 0 and 1.
• It is the extension of linear regression but is mainly used for
classification problems
Key Points:
• Logistic regression predicts the output of a categorical
dependent variable. Therefore, the outcome must be a
categorical or discrete value.
• It can be either Yes or No, 0 or 1, true or False, etc. but instead
of giving the exact value as 0 and 1, it gives the probabilistic
values which lie between 0 and 1.
• In Logistic regression, instead of fitting a regression line, we fit
an “S” shaped logistic function, which predicts two maximum
values (0 or 1).
Logistic Function – Sigmoid Function
• The sigmoid function is a mathematical function used
to map the predicted values to probabilities.
• It maps any real value into another value within a
range of 0 and 1. The value of the logistic regression
must be between 0 and 1, which cannot go beyond
this limit, so it forms a curve like the “S” form.
• The S-form curve is called the Sigmoid function or the
logistic function.
• In logistic regression, we use the concept of the
threshold value, which defines the probability of either
0 or 1. Such as values above the threshold value tends
to 1, and a value below the threshold values tends to
0.

You might also like