Linear Regression Algorithm --Under The Hood Math For Non-Mathematicians
Step 1: We will use the python package NumPy for working with a sample dataset and Matplotlib to plot various graphs for visualisation. Step 2: Let us consider a simple scenario where a single input /independent variable controls the outcome/dependent variable value. In the code below, we have declared two NumPy arrays to hold the values of the independent and dependent variables. Step 3: Let us quickly draw a scatter plot to understand the data points. Our goal is to formulate a linear equation which can predict the dependent variable value with minimum error for an independent/input variable.
Aug-27-2020, 17:21:15 GMT
- Technology: