Створення систем рекомендацій у Python
Rob O'Callaghan
Director of Data


| ЕЛЕМЕНТ | Атрибут 1 | Атрибут 2 | Атрибут 3 | Атрибут 4 |
|---|---|---|---|---|
| Item_001 | 0 | 1 | 1 | 0 |
| Item_002 | 1 | 0 | 1 | 0 |
| Item_003 | 0 | 1 | 0 | 1 |
| Книга | Жанр |
|---|---|
| The Hobbit | Adventure |
| The Hobbit | Fantasy |
| The Great Gatsby | Tragedy |
| ... | ... |
| Книга | Adventure | Fantasy | Tragedy | ... |
|---|---|---|---|---|
| The Hobbit | 1 | 1 | 0 | ... |
| The Great Gatsby | 0 | 0 | 1 | ... |
| ... | ... | ... | ... | ... |
pd.crosstab( , )
pd.crosstab(book_genre_df['Book'], book_genre_df['Genre'])
| Книга | Adventure | Fantasy | Tragedy | Social commentary |
|---|---|---|---|---|
| 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 |
| ... | ... | ... | ... | ... |
Створення систем рекомендацій у Python