## 3 Improve Ant Collaborative Filtering with Dimension Reduction
### Dimension Reduction Version for ACF  
In the ACF algorithm, a unique type of pheromone is initially allocated to each user. However, in practice, it turns out that a lower number of pheromones types are needed, so it is more reasonable to initialize the users with similar preferences with the same type of pheromone. With this in mind, the types of pheromones can be reduced to alleviate the sparsity problem. We call the improved version as Improved Ant Collaborative Filtering (IACF). First, the users are clustered according to the rating patterns indicated by their pheromones. The parameter \(K\) stands for the expected types of pheromones. The user clusters generated are used for pheromone initialization, and various clustering techniques can also be used [23]. Several clustering methods have been tested, including K-means and spectral clustering, and the results show that the typical K-means is more suitable for our dataset, as it finds balance between more variance and overfitting. Thus, the K-means is used in the initialization phase in the IACF algorithms. The user pheromone is initialized by assigning each single user one type of pheromone valued \(k\in[1,K]\), where \(K<<\#users\). For multiple users within one cluster, a same value of \(k\) is assigned to every one of them. This is the difference between the IACF and ACF. The rest of the procedure remains the same. The pheromone for each item is initialized as zero. If user \(u_{i}\) rates item \(v_{j}\) with rating \(r_{i,j}\), the pheromones from both the user and the item are exchanged between them. The complete update of the pheromone for a user and an item are depicted, respectively, in Equations (1) and (2). More specifically, a user will update its pheromone after a rating is given by adding the item's pheromone times by a weight mixed with a rating adjustment and a constant \(\gamma\). The constant \(\gamma\) is used for controlling the spreading rate. Likewise, the item's pheromone will also be updated after a rating is given by adding the user's pheromone times by a weight, which is also a mix of rating adjustment and the constant \(\gamma\). The rating adjustment is the gap between the rating \(r_{ij}\) and the average rating. The greater the gap is, the stronger the user's preference is with respect to that item. If the rating is much higher than the average, then the transmission will be a strong positive \"plus\". Conversely, a rating \(r_{ij}\) that is much lower than the average, which means that the user and the item are unalike, results in negative values for the pheromones. \[ \begin{split} Ph_{v_{j}}^{(t+1)}=Ph_{v_{j}}^{(t)}\times\exp\left( \frac{amount_{v_{j},k}+\lambda}{Max_{k\in K}(amount_{v_{j},k})+\lambda}-1 \right)\\ +(r_{i,j}-\overline{r}_{u_{i}})\times\gamma\times Ph_{u_{i}}^{(t) }\end{split}  \tag{1}\]  
\[ \begin{split} Ph_{u_{i}}^{(t+1)}=Ph_{u_{i}}^{(t)}\times\exp\left( \frac{amount_{u_{i},k}+\lambda}{Max_{k\in K}(amount_{u_{i},k})+\lambda}-1 \right)\\ +(r_{i,j}-\overline{r}_{v_{j}})\times\gamma\times Ph_{v_{j}}^{(t) }\end{split}  \tag{2}\]  
The IACF algorithm is presented in Algorithm 1. The main difference between ACF and IACF is, at the pheromone initialization phase, where a clustering step is added, the training phase is kept unchanged with Algorithm 1 in [1]. ```
Input:\(Ratings\), \(U\), \(V\), \(K\) Output: Updated pheromone value for users and items // A leading clustering step  Using K-means to cluster users into \(K\) clusters according to their preference indicated by their pheromones.