Linear Regression is a Machine Learning algorithm. Based on Supervised Learning, a
linear regression attempts to model the linear relationship between one or more
predictor variables and a continuous target variable. By finding the relationship
between the predictors and target variables, we can predict a target value. To give an
example, based on certain house features (predictors) such as number of bedrooms
and total square feet, we can predict house prices (target)!
Types of Variables
Independent Variable (features): data that is standalone and cannot be
controlled directly, has direct effect on the dependent variable
Dependent Variables (target): data that is controlled directly, directly affected by
the independent variables
Example: income (independent) depends on other features (dependent) such as
education level, age, marriage status
What is Regression?
Regression: statistical method used to understand the relationships between
variables
Simple Linear Regression: single feature to model a linear relationship with a
target variable
, Multiple Linear Regression: uses multiple features to model a linear relationship
with a target variable
Simple Linear Regression
Let’s start off with simple linear regression since that’s the easiest to start with. We
have data points that pertain to something in which we plot the independent variable
on the X-axis and the dependent variable on the Y-axis.
The straight line is the “line of best fit” as it best describes the relationship between
the independent and dependent variable. Once we have the line of best fit, we can
start predicting!