... | @@ -260,28 +260,28 @@ Next... let us jump to the `main` function and... |
... | @@ -260,28 +260,28 @@ Next... let us jump to the `main` function and... |
|
1. set up the input data (points)
|
|
1. set up the input data (points)
|
|
|
|
|
|
```python
|
|
```python
|
|
points = [(0., 0.), (1., 1.), (2., 4.)]
|
|
points = [(0., 0.), (1., 1.), (2., 4.)]
|
|
```
|
|
```
|
|
|
|
|
|
2. create the `X` matrix
|
|
2. create the `X` matrix
|
|
```python
|
|
```python
|
|
matrix_X = np.array([[1., 0., 0.],
|
|
matrix_X = np.array([[1., 0., 0.],
|
|
[1., 1., 1.],
|
|
[1., 1., 1.],
|
|
[1., 2., 4.]])
|
|
[1., 2., 4.]])
|
|
```
|
|
```
|
|
|
|
|
|
3. create the `Y` matrix
|
|
3. create the `Y` matrix
|
|
|
|
|
|
```python
|
|
```python
|
|
matrix_Y = np.array([0,
|
|
matrix_Y = np.array([0,
|
|
1,
|
|
1,
|
|
4])
|
|
4])
|
|
```
|
|
```
|
|
|
|
|
|
4. compute X-transpose
|
|
4. compute X-transpose
|
|
|
|
|
|
```python
|
|
```python
|
|
matrix_XT = matrix_X.transpose()
|
|
matrix_XT = matrix_X.transpose()
|
|
```
|
|
```
|
|
|
|
|
|
After setting everything up... it is time for a couple matrix multiplications.
|
|
After setting everything up... it is time for a couple matrix multiplications.
|
... | | ... | |