---
# System prepended metadata

title: Lecture Notes ML4AI 2021
tags: [COTAI LHP]

---

---
tags: COTAI LHP
---

# Lecture Notes ML4AI 2021

## SESSION 4: RecSys: Recommender Systems
- widely use as core engine for user platforms (amazon,spotify,etc)
    
((recsys success story insert))

- can learn to serve humans: Virtual assistant, cobot

### Generalization counts
- Observe items or users and recommend other items to the users 
- **vital for a good RecSys** 
    
### Personalization counts 
- going beyond common statistics of the mass 
- have a unique differentiated stats between users 
- **vital for a good RecSys**

### Long-tail issues 
 (insert image here)
 
### Problem formulation



- $Input: users' rating \rightarrow Output: prediction(rating, stars,etc.)$
- Two common methods: **User-based filtering** and **Item-based filtering**

#### Input Data
![](https://i.imgur.com/H0uSsqe.png)

    
#### Taxonomy 
![](https://i.imgur.com/I0z56IK.png)
 
    
### Collaborative filtering
![](https://i.imgur.com/RWQFs9r.png)


- Require: 
    - $\overrightarrow{Z}$ : embeddings 
    - similarity 

##### Item-based CF 
![](https://i.imgur.com/1CzwP3O.png)
- Key idea: users as features → compute item-item similarity matrix.
-  Advantage: items don’t change much as users.


##### User-based CF
![](https://i.imgur.com/oO48Tcy.png)
- Key idea: items as features → compute user-user similarity matrix.
###### Note: Transposing the utility matrix in user-based CF before computing basically gives item-based CF result (more efficient since $n^o$ of users > $n^o$ of items).
    
##### Matrix factorization (model-based) CF
![](https://i.imgur.com/TxUcROW.png)
- Key idea: user-item weighted-sum/similarity score ≈ rating score
    
- SVD: singular vector decomposition.


- Matrix factorization solved by Regularized Alternating Least Squares
- Solved by truncated SVD ***after*** CF

### Personalized RecSys
![](https://i.imgur.com/xdoht2n.png)



#### Content-based filtering
![](https://i.imgur.com/0IFka6z.png)
- Key idea: $\theta_k⋅z_i+b_k= user_k–item_i$, weighted sum score ≈ rating (could be formulated as a regression or a classification problem)




#### Context-aware & KB personalized RecSys!
[](https://i.imgur.com/7tlsUUH.png)



### Hybrid RecSys 
![](https://i.imgur.com/AmRAync.png)