# TD-DNN: A Time Decay-Based Deep Neural Network for Recommendation System
## 4 Proposed Methodology
### Data Preprocessing Phase
#### 4.1.2 Applying Time Decay Functions  
The CF technique-based algorithms provide recommendations based on the user's historical rating data, but the user's interest changes with time. Therefore, to give weightage to the most recent ratings, a time decay function [59] is incorporated with ratings. These time functions [60; 61; 62] determine the appropriate time weights and provide high weightage to the recently rated items. In Table 8, a list of time decay functions is given, and they are applied to the ML-100k dataset to identify the best option. The results are displayed in the next section. Here, \(\mu\), \(\alpha\), \(\beta\), \(\omega\), \(\gamma\) and \(\lambda\) are the tuning parameter, while \(t\) is the difference between the recent timestamp and timestamp at which item is rated. The first time-based recommendation algorithm was developed by [PERSON] et al. [64], who reframed the recommendation issue as a time series prediction problem. In CF, time decay functions can be applied at the similarity computation, prediction, or rating matrix levels. Since we are not predicting the ratings using a similarity measure in this paper, we \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Classification** & **Users** & 1**Weak\_User\_l & 1**Average\_User\_l & 1**Strong\_User\_l & **Class** \\ \hline \multirow{4}{*}{Users} & U\({}_{1}\) & 0 & 1 & 3 & \begin{tabular}{c} Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ \end{tabular} \\ \multirow{4}{*}{Items} & U\({}_{2}\) & 1 & 0 & 3 & \
\begin{tabular}{c} Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ Benevolent \\ \end{tabular} \\ \multirow{4}{*}{Items} & U\({}_{1}\) & 1 & 2 & 1 &
\begin{tabular}{c} Averagely recommended \\ Strongly recommended \\ Strongly recommended \\ Strongly recommended \\ Strongly recommended \\ Strongly recommended \\ Strongly recommended \\ Strongly recommended \\ Strongly recommended \\ Strongly recommended \\ \\ \hline \hline \end{tabular}
\end{table} 
Table 6: User and Item Classification for the Given Example. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Function** & **Mathematical Expression** & **References** \\ \hline Exponential & \(e^{-|\mathbf{I}|T_{\mu\alpha}|}\) & [31; 63] \\ Concave & \(a^{|T_{\mu\alpha}|}\) & [62] \\ Convex & \(1-\beta^{t-|T_{\mu\alpha}|}\) & [62] \\ Linear & \(1-\frac{|T_{\mu\alpha}|}{1}\gamma\) & [62] \\ Logistic & \(\frac{1}{1+e^{-\frac{\mathbf{I}}{\alpha}\cdot\mathbf{I}_{\mu\alpha}|}}\) & [33; 59] \\ Power & \(|T_{\mu,\lambda}|^{-\omega}\) & [59] \\ \hline \hline \end{tabular}
\end{table} 
Table 8: List of Time Decay Functions. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **I\({}_{1}\)** & **I\({}_{2}\)** & **I\({}_{3}\)** & **I\({}_{4}\)** \\ \hline U\({}_{1}\) & 3 & 5 & 4 & 4 \\ U\({}_{2}\) & 2 & 5 & 4 & 4 \\ U\({}_{3}\) & 3 & 3 & 2 & 5 \\ U\({}_{4}\) & 4 & 4 & 4 & - & 1 \\ \hlinecan apply these time functions at the rating matrix level only. Here, the ratings closer to the current time are given a larger weighting coefficient. The time-weighted ratings can be retrieved as follows  
\[R_{u,i}\ =\ r_{u,i}\times\ \text{Time Decay Function} \tag{2}\]  
where \(R_{u,i}\) is the predicted rating, \(r_{u,i}\) is the actual ratings, and the time decay functions are listed in Table 8. The results of time functions are displayed in Section 5.5, clearly stating that the performance of the power decay function is superior; hence, it is used in the research. With the help of the power time function, firstly, weights are computed and then multiplied with the non-noisy rating dataset to give weightage to the most recent ratings. Here, high weightage is assigned to recent timestamp ratings.