# Applying Recommender Systems to Predict Personalized Film Age Ratings for Parents
## 4 Proposed Methodology  
The proposed framework aims to address the problem of predicting personalized film age ratings for parents by employing multiple recommender systems (MRSs) tailored to individual age categories. This approach transforms the problem into a multi-faceted recommendation task, leveraging the strengths of modern recommender system algorithms. The methodology includes several stages: data transformation, training multiple models, and aggregating predictions to generate the final personalized rating. Below is a detailed explanation of the methodology:  
According to the problem formulation, the given dataset consists of triples \((p,f,c(p,f))\), where \(p\in U,f\in I\) and \(c(p,f)\in AC\) denote the parent id, film id and the age category of the film, \(f\), according to the belief of the parent, \(p\), respectively. The dataset is divided into the training (\(TR\)) and test set (\(TS\)). The proposed framework consists of training and testing phases (see Figure  
\(i\). According to the definition of \(c(p,f)\), \(r_{i}(p,f)\) can be defined by the following delta function, according to \(c(p,f)\):  
\[r_{i}(p,f)=\begin{cases}1,&i=c(p,f)\\ 0,&\text{-}\end{cases} \tag{2}\]  
However, better results are obtained when we allow non-zero values for values of \(i\) in the neighborhood of \(c(p,f)\). As an example, one approach involves using a partially linear function \(r_{i}(p,f)\) (triangular function), as defined in Equation (3), so that the belief of the parent gradually decreases as we move away from the selected age category \(c(p,f)\):  
\[r_{i}(p,f)=max(0,1-\lambda\cdot|c(p,f)-i|) \tag{3}\]  
where the parameter \(\lambda\in(0,1]\) (e.g., \(\lambda=0.2\)) corresponds to the slope of the triangular function. It should be noted that when \(\lambda=1\), we have the special case of the delta function.
* According to the proposed methodology, the training set \(S_{i}\) for each recommender system \(RS_{i}\), \(i\in AC\) defined on line 5 in Algorithm 1 is based on Equation (3). Finally, the \(trainRS\) procedure on line 7 in Algorithm 1 trains the recommender system \(RS_{i}\) by using the training set \(S_{i}\) (i.e., the \((p,f,r_{i}(p,f))\) triplets that correspond to the same age category). The final recommendation combines the resulting recommendations \(R_{i}\) of the recommender systems \(RS_{i}\), \(i\in AC\) (see Figure 2). The output of each recommender system for a parent, \(p\), and an item, \(f\), corresponds to the predicted belief of that user that that item is appropriate for that age category. One natural way to combine the resulting recommendations, as conducted in classification problems, is to select the age category with the highest recommendation (see Equation (4)) to produce a single cage category as the final output, as follows: \[\overline{AR}=\operatorname*{argmax}_{i\in AC}R_{i}\] (4) However, taking into account that the age categories are numerical values, better results are obtained when we obtain the expected value of the recommendation, as defined in the following equation: \[\overline{AR}=\frac{\sum\limits_{i\in AC}R_{i}\cdot i}{\sum\limits_{i\in AC}R _{i}}\] (5)  
```
input :\(TR\), \(AC\) output :\(RS_{i}\), \(i\in AC\)
1 foreach\(i\in AC\)do
2\(S_{i}=\emptyset\)foreach\((p,f,c(p,f))\in TR\)do
3\(r_{i}(p,f)=max(0,1-\lambda\cdot|c(p,f)-i|)\)\(S_{i}=S_{i}(u,f,r_{i}(p,f))\)
4 end fore
5\(RS_{i}=trainRS(S_{i})\)
6 end fore
7
8 end fore
9
10 end fore
```  
**Algorithm 1**The training phase of the proposed method.