ageron / ageron/handson-ml2

[QUESTION] Chapter 9 Label propagation

Abierto
#564 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
30k
Forks
13.1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I dont get these lines of the code

```python
k=50
y_representative_digits = np.array([4, 8, 0, 6, 8, 3, ..., 7, 6, 2, 3, 1, 1])
y_train_propagated = np.empty(len(X_train), dtype=np.int32)

for i in range(k):
y_train_propagated[kmeans.labels_==i] = y_representative_digits[i]
```

If for example the `i` of the for loop is 2. Then the indices of `y_train_propagated[kmeans.labels_==i]` (where `kmeans.labels_==2` is true) will be set to 0 because `y_representative_digits[2]` is equivalent to 0, right?

So the indices of `y_train_propagated` where `kmeans.labels_` is equal to 2 will be set to zero. The label is 2 but it is set to 0. Wouldn't that be wrong?

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.