rasbt / rasbt/python-machine-learning-book
Chapter 8: Shuffling the DataFrame in newer versions of pandas
Nessuno ha ancora preso questa issue.
- Lingua principale
- Jupyter Notebook
- Stelle
- 12.6k
- Fork
- 4.4k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Just a note in case it's helpful to anyone else - I seemed to be getting 100% accuracy with the on-line sentiment analysis classifier (pages 246-246), but it turned out to be because the code used to shuffle the dataset before exporting it to CSV on page 235 hadn't worked.
In the version of pandas I'm using (0.23.4), it looks like df.index.values is needed in order to get the indexes of a DataFrame as a list. So, this:
df = df.reindex(np.random.permutation(df.index))
now needs to be this:
df = df.reindex(np.random.permutation(df.index.values))
Hope that helps someone!
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal codice di shuffle del DataFrame a pagina 235 e verifica come si comporta con pandas 0.23.4 prima che il dataset venga esportato in CSV. Verifica che il CSV risultante sia effettivamente mischiato e che l’esempio di sentiment-analysis alle pagine 246-246 non riporti più un’accuratezza fuorviante dovuta a dati ordinati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- pandas, python
- Ambito
- machine-learning
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100