ageron / ageron/handson-ml

numpy permutation issue

Abierto
#394 2 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
25.6k
Forks
12.7k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi, I just want to understand the rules of the permutation used in numpy
see this is the code used in example2

```
import numpy as np

shuffle_index = np.random.permutation(60000)
X_train, y_train = X_train[shuffle_index], y_train[shuffle_index]
```

well, let us use 6 instead of 60000. So after run the 1st code, the `shuffle_index` could be:
[4,5,2,6,3,1], it is an array, right?

then I can not understand the `X_train[shuffle_index]`, so it is what? `X_train[[4,5,2,6,3,1]]`, I guess we want the `X_train` can be ordered as `X_train[4], X_train[5], X_train[2]...`. but this can be done by `X_train[shuffle_index]`?

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.