內容導向推薦入門

用 Python 建立推薦引擎

Rob O'Callaghan

Director of Data

什麼是內容導向推薦?

顯示推薦與使用者喜好相似書籍的圖片。

用 Python 建立推薦引擎

項目的屬性與特徵

書籍及其屬性的圖片。

用 Python 建立推薦引擎

將屬性向量化

項目 屬性 1 屬性 2 屬性 3 屬性 4
Item_001 0 1 1 0
Item_002 1 0 1 0
Item_003 0 1 0 1
用 Python 建立推薦引擎

一對多關係

書名 類型
The Hobbit Adventure
The Hobbit Fantasy
The Great Gatsby Tragedy
... ...
書名 Adventure Fantasy Tragedy ...
The Hobbit 1 1 0 ...
The Great Gatsby 0 0 1 ...
... ... ... ... ...
用 Python 建立推薦引擎

交叉列聯表

pd.crosstab(                     ,                       )
用 Python 建立推薦引擎

交叉列聯表

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 建立推薦引擎

一起來練習吧!

用 Python 建立推薦引擎

Preparing Video For Download...