... | ... | @@ -257,13 +257,14 @@ def print_matrices(matrix_XTX, matrix_XTY): |
|
|
|
|
|
Next... let us jump to the `main` function and...
|
|
|
|
|
|
1. set up the input data (points)
|
|
|
- set up the input data (points)
|
|
|
|
|
|
```python
|
|
|
points = [(0., 0.), (1., 1.), (2., 4.)]
|
|
|
```
|
|
|
|
|
|
2. create the `X` matrix
|
|
|
- create the `X` matrix
|
|
|
|
|
|
```python
|
|
|
matrix_X = np.array([[1., 0., 0.],
|
|
|
[1., 1., 1.],
|
... | ... | @@ -272,11 +273,11 @@ Next... let us jump to the `main` function and... |
|
|
|
|
|
3. create the `Y` matrix
|
|
|
|
|
|
```python
|
|
|
```python
|
|
|
matrix_Y = np.array([0,
|
|
|
1,
|
|
|
4])
|
|
|
```
|
|
|
```
|
|
|
|
|
|
4. compute X-transpose
|
|
|
|
... | ... | |