From the course: Deep Learning: Getting Started
Linear regression
- [Instructor] One of the basic statistical concepts that is used in machine learning is linear regression. It forms a key foundation for deep learning. Linear regression is a linear model that explains the relationship between two or more variables. We have a dependent variable y and an independent variable x. The model provides an equation to compute the value of y based on the value of x. To compute this, we need two constants called a, which is the slope, and an intercept, which is b. The formula for computing y is ax plus b. This provides a linear relationship between y and x. In reality, the relationship may not be perfectly linear, so there will be errors in predictions. Linear regression is used in regression problems to predict continuous variables. It can be applied for multiple independent variables like x1, x2, up to xn. In which case, there will be an equal n slope of values a1, a2, up to an. Let's look at an example for building a linear regression model. When we say we build a linear regression model, we are determining the value of the slope and intercept that models the relationship between the dependent and independent variables. To determine the slope and intercept, we will start with known values of x and y. You may have learned this in your math classes in school or college. For one independent variable, we start with two equations and then make substitutions to determine the value of a and b. Then the values of a and b can be applied to situations where y is not known. When there are multiple independent variables, this situation becomes complex. A related technique that is most used in deep learning is logistic regression. Logistic regression is a binary model that defines the relationship between two variables. The output y in this case is either zero or one. The formula is similar to linear regression, except that we use an additional activation function called f to convert the continuous variable coming out of ax plus b into a boolean value of zero or one. There are multiple options and variations of the function f. This equation, again, can be extended to multiple independent variables x1 to xn. We will look at an analogy for deep learning using the linear regression equation next.