ageron / ageron/handson-ml3

[QUESTION] why in chapter 4 code example in colab A is not Identity matrix?

Abierto
#72 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
14.1k
Forks
5.3k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Thanks for helping us improve this project!

**Before you create this issue**
Please make sure you are using the latest updated code and libraries: see https://github.com/ageron/handson-ml3/blob/main/INSTALL.md#update-this-project-and-its-libraries

Also please make sure to read the FAQ (https://github.com/ageron/handson-ml3#faq) and search for existing issues (both open and closed), as your question may already have been answered: https://github.com/ageron/handson-ml3/issues

**Describe what is unclear to you**
Hi
for the closed form of regularization in regression Equation 4-9 is discussed in the book
it is mentioned that A is an identity matrix
there is one part in the Colab of the chapter for the closed form but A is defined as [0, 0][0, 1].
Is there any special reason for that or am I missing something
I saw the np.ones is used for X_b
but I still don't get why A is not defined as [1, 0][0,1]

**To Reproduce**
If the question relates to a specific piece of code, please copy the code that fails here, using code blocks like this:

```python
alpha = 0.1
A = np.array([[0., 0.], [0., 1.]])
X_b = np.c_[np.ones(m), X]
np.linalg.inv(X_b.T @ X_b + alpha * A) @ X_b.T @ y
```

**Expected behavior**
If applicable, a clear and concise description of what you expected to happen.

**Screenshots**
![image](https://user-images.githubusercontent.com/53435529/233630587-4a53b821-4fb9-4627-84bd-836ae81b74c0.png)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.