
Our job is to find the value of a new y when we have the value of a new x. Let the feature variable be x and the output variable be y. In simple linear regression, we have only one feature variable and one target variable. The Linear Regression Equationīefore diving into the coding details, first, let’s know a bit more about simple linear regression.

It will teach you all the basics, including the mathematics behind linear regression, and how it is actually used in machine learning. Note: If you want to get a bit more familiarity with Linear Regression, then you can go through this article first. In this article, we will be implementing Simple Linear Regression from Scratch using Python. Also, it is quite easy for beginners in machine learning to get a grasp on the linear regression learning technique. The slope b1 tells us how a change in the input causes changes in the output.Linear Regression is one of the oldest statistical learning methods that is still used in Machine Learning. The term b0 is the intercept, b1 is the slope of the regression line, x is the input variable, e is the error term, and y is the predicted value of the response variable. In simple terms, linear regression helps to find the relation between two variables and is a type of supervised algorithm.Ī linear regression line has an equation of the form: Predicting a response using one or more input features, that is given a set of input data points (X) and responses (Y), simple linear regression tries to fit a line that passes through the maximum number of points while minimizing the squared distance of the points to the fitted line values. Linear regression can be used to create a predictive model on apparently random data, showing trends in the dataset, such as in cancer diagnoses or in stock prices. Linear regression looks at various data points and aims at fitting a trend line.


Linear regression is a kind of statistical analysis that attempts to model the relationship between a scalar response and one or more explanatory variables.
