Bygga rekommendationsmotorer i Python
Rob O'Callaghan
Director of Data


| OBJEKT | Attribut 1 | Attribut 2 | Attribut 3 | Attribut 4 |
|---|---|---|---|---|
| Item_001 | 0 | 1 | 1 | 0 |
| Item_002 | 1 | 0 | 1 | 0 |
| Item_003 | 0 | 1 | 0 | 1 |
| Bok | Genre |
|---|---|
| The Hobbit | Äventyr |
| The Hobbit | Fantasy |
| The Great Gatsby | Tragedi |
| ... | ... |
| Bok | Äventyr | Fantasy | Tragedi | ... |
|---|---|---|---|---|
| The Hobbit | 1 | 1 | 0 | ... |
| The Great Gatsby | 0 | 0 | 1 | ... |
| ... | ... | ... | ... | ... |
pd.crosstab( , )
pd.crosstab(book_genre_df['Book'], book_genre_df['Genre'])
| Bok | Äventyr | Fantasy | Tragedi | Social kommentar |
|---|---|---|---|---|
| The Hobbit | 1 | 1 | 0 | 0 |
| The Great Gatsby | 0 | 0 | 1 | 1 |
| A Game of Thrones | 0 | 1 | 0 | 0 |
| Macbeth | 0 | 0 | 1 | 0 |
| ... | ... | ... | ... | ... |
Bygga rekommendationsmotorer i Python