@@ -32,7 +32,7 @@ shows a data set with a linear relationship.
32
32
33
33
**Figure 1. A sample data set with a linear relationship ** [`code `__]
34
34
35
- .. __ : /code/overview/linear_regression/linear_regression.py
35
+ .. __ : https://github.com/machinelearningmindset/machine-learning-course/blob/master /code/overview/linear_regression/linear_regression.py
36
36
37
37
Our goal is to find the line that best models the path of the data points
38
38
called a line of best fit. The equation in *Equation 1 *, is an example of a
@@ -49,7 +49,7 @@ through it.
49
49
50
50
**Figure 2. The data set from Figure 1 with a line of best fit ** [`code `__]
51
51
52
- .. __ : /code/overview/linear_regression/linear_regression_lobf.py
52
+ .. __ : https://github.com/machinelearningmindset/machine-learning-course/blob/master /code/overview/linear_regression/linear_regression_lobf.py
53
53
54
54
Let’s break it down. We already know that x is the input value and y is our
55
55
predicted output. a₀ and a₁ describe the shape of our line. a₀ is called the
@@ -80,7 +80,7 @@ relationship so linear regression would not be a good choice.
80
80
81
81
**Figure3. A sample data set without a linear relationship ** [`code `__]
82
82
83
- .. __ : /code/overview/linear_regression/not_linear_regression.py
83
+ .. __ : https://github.com/machinelearningmindset/machine-learning-course/blob/master /code/overview/linear_regression/not_linear_regression.py
84
84
85
85
It is worth noting that sometimes you can apply transformations to data so
86
86
that it appears to be linear. For example, you could apply a logarithm to
@@ -97,7 +97,7 @@ transformed to have a linear relationship.
97
97
98
98
**Figure 4. A sample data set that follows an exponential curve ** [`code `__]
99
99
100
- .. __ : /code/overview/linear_regression/exponential_regression.py
100
+ .. __ : https://github.com/machinelearningmindset/machine-learning-course/blob/master /code/overview/linear_regression/exponential_regression.py
101
101
102
102
*Figure 5 * is the same data after transforming the output variable with a
103
103
logarithm.
@@ -107,7 +107,7 @@ logarithm.
107
107
**Figure 5. The data set from Figure 4 after applying a logarithm to the
108
108
output variable ** [`code `__]
109
109
110
- .. __ : /code/overview/linear_regression/exponential_regression_transformed.py
110
+ .. __ : https://github.com/machinelearningmindset/machine-learning-course/blob/master /code/overview/linear_regression/exponential_regression_transformed.py
111
111
112
112
113
113
*************
@@ -124,7 +124,7 @@ for one such prediction.
124
124
**Figure 6. The plot from Figure 2 with the cost of one prediction
125
125
emphasized ** [`code `__]
126
126
127
- .. __ : /code/overview/linear_regression/linear_regression_cost.py
127
+ .. __ : https://github.com/machinelearningmindset/machine-learning-course/blob/master /code/overview/linear_regression/linear_regression_cost.py
128
128
129
129
Two common terms that appear in cost functions are the **error ** and
130
130
**squared error **. The error [*Equation 2 *] is how far away from the actual
@@ -206,12 +206,12 @@ Code
206
206
****
207
207
This module's main code is available in the linear_regression_lobf.py _ file.
208
208
209
- .. _linear_regression_lobf.py : /code/overview/linear_regression/linear_regression_lobf.py
209
+ .. _linear_regression_lobf.py : https://github.com/machinelearningmindset/machine-learning-course/blob/master /code/overview/linear_regression/linear_regression_lobf.py
210
210
211
211
All figures in this module were created with simple modifications of the
212
212
linear_regression.py _ code.
213
213
214
- .. _linear_regression.py : /code/overview/linear_regression/linear_regression.py
214
+ .. _linear_regression.py : https://github.com/machinelearningmindset/machine-learning-course/blob/master /code/overview/linear_regression/linear_regression.py
215
215
216
216
In the code, we analyze a data set with a linear relationship. We split the
217
217
data into a training set to train our model and a testing set to test its
0 commit comments