![hyperplan equation hyperplan equation](https://miro.medium.com/max/1920/1*Lm3kGAZfwD_bcCbhrVKS-g.jpeg)
Let’s quickly recap how a multiple linear regression model works: So our model has returned an estimated value of -1675 for the dependent variable! Recap This would mean that our hyperplane equation would be in this form: Let’s say that our model was trained on a dataset with two independent variables.
![hyperplan equation hyperplan equation](https://image.slidesharecdn.com/linesplanesandhyperplanes-121123013122-phpapp01/95/lines-planes-and-hyperplanes-5-638.jpg)
This equation can then be used to predict future values. Please read the article before proceeding with this one.Īfter completing gradient descent, our algorithm will have finalized all the parameter values and created the equation of the optimal hyperplane. Because of its complexity, I have written a whole other article solely dedicated to explaining the intuition and mathematics behind gradient descent. Gradient descent is a complex algorithm, but it is necessary to learn how it works. This where a process called gradient descent comes into play. Okay, so now that the model has the error for its hyperplane, it can tune all the parameter values to reduce the cost. Once you finish reading that, you can come back right away and continue with this one! I wrote another article dedicated to both univariate and multivariate MSE, which I highly suggest you check out since MSE is a foundational concept in regression algorithms. By determining how well a hyperplane represents the data, the regression model can tune the values of the parameters (i.e b_0, b_1, etc.) and optimize accuracy. The cost can be calculated by many different formulas, but the one that linear regression uses is known as the multivariate Mean Squared Error (MSE) Cost Function. It does this by calculating a metric known as cost, which is the degree of error between the hyperplane’s values and those of the training dataset. This means that the regressor will have to try out several different equations to see which hyperplane best fits the data.īut how does it determine how “well” a hyperplane represents the training set? The Cost Function So, the regressor tries to create an equation of a hyperplane that best represents the training data it is given. In this sample representation, the two horizontal axes represent the independent variables while the vertical axis represents the dependent variable. Let’s take a look at multiple linear regression’s equation to visualize this. With multiple linear regression, however, we could have any number of parameters. With simple linear regression, we had two parameters that needed to be tuned: b_0 (the y-intercept) and b_1 (the slope of the line). Much like simple linear regression, multiple linear regression works by changing parameter values to reduce cost, which is the degree of error between the model’s predictions and the the values in the training dataset. How does Multiple Linear Regression Work? Model Representation This is where multiple linear regression comes in.Ī multiple linear regression model is able to analyze the relationship between several independent variables and a single dependent variable in the case of the lemonade stand, both the day of the week and the temperature’s effect on the profit margin would be analyzed. We explained how this model could be used to estimate the profit margin of a lemonade stand when given the average temperature of a certain day.īut what if we also wanted to include the day of the week in our model? Last time, we discussed a model known as simple linear regression, which is designed to find a relationship between a single independent and dependent variable.