# Hybrid Sparrow Clustered (HSC) Algorithm for Top-N Recommendation System

^{1}

^{2}

^{3}

^{4}

^{5}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Work

## 3. Materials and Methods

#### 3.1. Clustering Using Sparrow Search

- (1)
- The producers usually have a lot of energy and give scavengers places or directions to look for food. They are in charge of finding places where a lot of food can be found. The amount of energy each person has is based on how well they are thought of by others.
- (2)
- As soon as the sparrow sees the predator, the birds start to chirp as a warning. To keep people safe, producers have to lead all scavengers to the safe area when the alarm value is higher than the safety level.
- (3)
- Each sparrow can become a producer as long as it looks for the best places to get food, but the overall population doesn’t change.
- (4)
- The sparrows with the most energy would be the ones who made the food. Several people who are starving are more likely to fly to other places to get food so that they can have more energy to do things.
- (5)
- The scavengers follow the person who can give them the best food as they look for food. In the meantime, some scavengers may keep an eye on the people who make the food and compete with each other to get more.
- (6)
- The sparrows at the edge of the group move quickly to a safe area when they sense danger. The sparrows in the middle move around so they can be near other people.

Algorithm 1. Algorithm fir clustering using sparrow search |

Input |

• data: the dataset to be clustered |

• K: the number of clusters to be generated |

• N: the number of sparrows |

• P: the number of producers |

• S: the number of sparrow who sense the danger |

• G: the maximum iterations |

Algorithm |

1. Create N sparrow, each having K cluster heads with random normalized values. |

2. Create clusters of data for each sparrow (based on shortest Euclidean distance). |

3. Calculate the fitness of each sparrow. |

4. Rank the sparrows and find the current best and cueeent worst sparrow. |

5. for $i=1$ to P: update sparrow location using Equation (1). |

6. for $i=P+1$ to N: update sparrow location using Equation (2). |

7. for i = 1 to S: update sparrow location using Equation (3). |

8. Change the location of each sparrow if it is better than the old location. |

9. Repeat the step 3–8 for G iterations. |

10. Return the cluster- heads of the fittest sparrow. |

Output: Optimal clusters |

#### 3.2. Generating Recommendation by Using Sparrow Clustered Recommendation System

## 4. Results

#### 4.1. Phase I: Training Phase

#### 4.2. Phase II: Process of Recommendation for Active Users

#### 4.2.1. Mean Absolute Error (MAE)

#### 4.2.2. Standard Deviation (SD)

#### 4.2.3. Root Mean Square Error (RMSE)

#### 4.2.4. t-Value

#### 4.2.5. Precision

#### 4.2.6. Recall

- MovieLens 100,000—an original dataset composed from the MovieLens website (movielens.umn.edu, accessed on 4 May 2022) in a time frame of 7 months (i.e., from 19 September 1997 to 22 April 1998) consists of 100,000 ratings of 1682 movies from 943 users. Rating scale ranges between 1 and 5. Data is easily available for experimental computation and analysis.
- MovieLens 1 million—This Dataset consists of four features: userID, MovieID, rating, and timestamp. It includes 6040 MovieLens users who provided 1,000,209 ratings of 3900 movies. With a rating scale of 1–5 stars, every single user provides a minimum of 20 ratings.
- Jester—Jester is a dataset of 59,132 users and 150 jokes, and consists of 1.7 million ratings ranging between −10 and 10. It is widely available and is often used for experimental examination of collaborative filtering recommender systems. The dataset features include [userid], [itemid] and [rating]. University of California, Berkeley created this dataset, and the data is associated with an online joke-recommendation system.
- Epinion—A total of 664,824 ratings of 139,738 items from 49,290 users constitutes the Epinion dataset. Open-source data composed from Epinion.com includes userid, itemid, and rating. A scale is set ranging from 1–5 for rating individual items. The performance of the proposed sparrow-based recommendation system is based on a different cluster size.

## 5. Conclusions and Future Scope

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Civicioglu, P.; Besdok, E. A conceptual comparison of the Cuckoo-search, particle swarm optimization, differential evolution and artificial bee colony algorithms. Artif. Intell. Rev.
**2013**, 39, 315–346. [Google Scholar] [CrossRef] - Bobadilla, J.; Ortega, F.; Hernando, A.; Gutiérrez, A. Recommender systems survey. Knowl.-Based Syst.
**2013**, 46, 109–132. [Google Scholar] [CrossRef] - Adomavicius, G.; Tuzhilin, A. Toward the next generation of recommender systems: A survey of the state-of-the-art and possible extensions. IEEE Trans. Knowl. Data Eng.
**2005**, 17, 734–749. [Google Scholar] [CrossRef] - Fahad, A.; Alshatri, N.; Tari, Z.; Alamri, A.; Khalil, I.; Zomaya, A.Y.; Foufou, S.; Bouras, A. A survey of clustering algorithms for big data: Taxonomy and empirical analysis. IEEE Trans. Emerg. Top. Comput.
**2014**, 2, 267–279. [Google Scholar] [CrossRef] - Herlocker, J.; Konstan, J.A.; Riedl, J. An empirical analysis of design choices in neighborhood-based collaborative filtering algorithms. Inf. Retr.
**2002**, 5, 287–310. [Google Scholar] [CrossRef] - Konstan, J.A.; Riedl, J. Recommender systems: From algorithms to user experience. User Model. User-Adapt. Interact.
**2012**, 22, 101–123. [Google Scholar] [CrossRef][Green Version] - Zhang, X.; Qin, J.; Zheng, J. A Social Recommendation based on metric learning and Users’ Co-occurrence Pattern. Symmetry
**2021**, 13, 2158. [Google Scholar] [CrossRef] - Addagarla, S.K.; Amalanathan, A. Probabilistic unsupervised machine learning approach for a similar image recommender system for E-commerce. Symmetry
**2020**, 12, 1783. [Google Scholar] [CrossRef] - Sarwar, B.; Karypis, G.; Konstan, J.; Riedl, J. Item-based collaborative filtering recommendation algorithms. In Proceedings of the 10th international conference on World Wide Web, Hong Kong, China, 1–5 May 2001; pp. 285–295. [Google Scholar]
- Salter, J.; Antonopoulos, N. CinemaScreen recommender agent: Combining collaborative and content-based filtering. IEEE Intell. Syst.
**2006**, 21, 35–41. [Google Scholar] [CrossRef] - Van Meteren, R.; Van Someren, M. Using content-based filtering for recommendation. In Proceedings of the Machine Learning in the New Information Age: MLnet/ECML2000 Workshop; 2000; Volume 30, pp. 47–56. Available online: https://www.semanticscholar.org/paper/Using-Content-Based-Filtering-for-Recommendation-Meteren/4a57e0f0641b7a70fece89c14fbf5030869ededb (accessed on 4 March 2022).
- Thorat, P.B.; Goudar, R.; Barve, S. Survey on collaborative filtering, content-based filtering and hybrid recommendation system. Int. J. Comput. Appl.
**2015**, 110, 31–36. [Google Scholar] - Krulwich, B. Lifestyle finder: Intelligent user profiling using large-scale demographic data. AI Mag.
**1997**, 18, 37. [Google Scholar] - Singh, S.P.; Solanki, S. Recommender system survey: Clustering to nature inspired algorithm. In Proceedings of the 2nd International Conference on Communication, Computing and Networking, Chandigarh, India, 29–30 March 2018; Springer: Berlin/Heidelberg, Germany, 2019; pp. 757–768. [Google Scholar]
- Burke, R. Hybrid web recommender systems. In The Adaptive Web; Springer: Berlin/Heidelberg, Germany, 2007; pp. 377–408. [Google Scholar]
- Porcel, C.; Tejeda-Lorente, A.; Martínez, M.; Herrera-Viedma, E. A hybrid recommender system for the selective dissemination of research resources in a technology transfer office. Inf. Sci.
**2012**, 184, 1–19. [Google Scholar] [CrossRef] - Park, D.H.; Kim, H.K.; Choi, I.Y.; Kim, J.K. A literature review and classification of recommender systems research. Expert Syst. Appl.
**2012**, 39, 10059–10072. [Google Scholar] [CrossRef] - Tsai, C.F.; Hung, C. Cluster ensembles in collaborative filtering recommendation. Appl. Soft Comput.
**2012**, 12, 1417–1425. [Google Scholar] [CrossRef] - Sharma, B.; Hashmi, A.; Kumar, A. Whale Optimization based Recommendation System. Int. J. Innov. Technol. Explor. (IJITEE)
**2019**, 8, 2640–2644. [Google Scholar] - Sangeeta; Sitender. Comprehensive analysis of hybrid nature-inspired algorithms for software reliability analysis. J. Stat. Manag. Syst.
**2020**, 23, 1037–1048. [Google Scholar] - Xue, J.; Shen, B. A novel swarm intelligence optimization approach: Sparrow search algorithm. Syst. Sci. Control Eng.
**2020**, 8, 22–34. [Google Scholar] [CrossRef] - Khalaf, O.I.; Abdulsahib, G.M.; Sabbar, B.M. Optimization of wireless sensor network coverage using the Bee Algorithm. J. Inf. Sci. Eng.
**2020**, 36, 377–386. [Google Scholar] - Wang, X.; Liu, J.; Liu, X.; Liu, Z.; Khalaf, O.I.; Ji, J.; Ouyang, Q. Ship feature recognition methods for deep learning in complex marine environments. Complex Intell. Syst.
**2022**, 1–17. [Google Scholar] [CrossRef] - Khaparde, A.R.; Alassery, F.; Kumar, A.; Alotaibi, Y.; Khalaf, O.I.; Pillai, S.; Alghamdi, S. Differential evolution algorithm with hierarchical fair competition model. Intell. Autom. Soft Comput.
**2022**, 33, 1045–1062. [Google Scholar] [CrossRef] - Subramani, N.; Mohan, P.; Alotaibi, Y.; Alghamdi, S.; Khalaf, O.I. An Efficient Metaheuristic-Based Clustering with Routing Protocol for Underwater Wireless Sensor Networks. Sensors
**2022**, 22, 415. [Google Scholar] [CrossRef] [PubMed] - Rajendran, S.; Khalaf, O.I.; Alotaibi, Y.; Alghamdi, S. MapReduce-based big data classification model using feature subset selection and hyperparameter tuned deep belief network. Sci. Rep.
**2021**, 11, 1–10. [Google Scholar] [CrossRef] [PubMed] - Zhao, H.; Chen, P.L.; Khan, S.; Khalafe, O.I. Research on the optimization of the management process on internet of things (Iot) for electronic market. Electron. Libr.
**2020**, 39, 526–538. [Google Scholar] [CrossRef] - Li, G.; Liu, F.; Sharma, A.; Khalaf, O.I.; Alotaibi, Y.; Alsufyani, A.; Alghamdi, S. Research on the natural language recognition method based on cluster analysis using neural network. Math. Probl. Eng.
**2021**, 2021, 9982305. [Google Scholar] [CrossRef] - Adigwe, I.; Oriola, J. Towards an understanding of job satisfaction as it correlates with organizational change among personnel in computer-based special libraries in Southwest Nigeria. Electron. Libr.
**2015**, 33, 773–794. [Google Scholar] [CrossRef] - Sengan, S.; Sagar, R.V.; Ramesh, R.; Khalaf, O.I.; Dhanapal, R. The optimization of reconfigured real-time datasets for improving classification performance of machine learning algorithms. Math. Eng. Sci. Aerosp. (MESA)
**2021**, 12, 43–54. [Google Scholar] - Herlocker, J.L.; Konstan, J.A.; Terveen, L.G.; Riedl, J.T. Evaluating collaborative filtering recommender systems. ACM Trans. Inf. Syst. (TOIS)
**2004**, 22, 5–53. [Google Scholar] [CrossRef] - Feng, L.; Zhao, Q.; Zhou, C. Improving performances of Top-N recommendations with co-clustering method. Expert Syst. Appl.
**2020**, 143, 113078. [Google Scholar] [CrossRef] - Wasid, M.; Ali, R. An improved recommender system based on multi-criteria clustering approach. Procedia Comput. Sci.
**2018**, 131, 93–101. [Google Scholar] [CrossRef] - Salah, A.; Rogovschi, N.; Nadif, M. A dynamic collaborative filtering system via a weighted clustering approach. Neurocomputing
**2016**, 175, 206–215. [Google Scholar] [CrossRef] - Wang, Z.; Yu, X.; Feng, N.; Wang, Z. An improved collaborative movie recommendation system using computational intelligence. J. Vis. Lang. Comput.
**2014**, 25, 667–675. [Google Scholar] [CrossRef] - Katarya, R.; Verma, O.P. A collaborative recommender system enhanced with particle swarm optimization technique. Multimed. Tools Appl.
**2016**, 75, 9225–9239. [Google Scholar] [CrossRef] - Bedi, P.; Sharma, R.; Kaur, H. Recommender system based on collaborative behavior of ants. J. Artif. Intell.
**2009**, 2, 40–55. [Google Scholar] [CrossRef][Green Version] - Katarya, R.; Verma, O.P. Recommender system with grey wolf optimizer and FCM. Neural Comput. Appl.
**2018**, 30, 1679–1687. [Google Scholar] [CrossRef] - Senbagaraman, M.; Senthilkumar, R.; Subasankar, S.; Indira, R. A movie recommendation system using collaborative approach and cuttlefish optimization. In Proceedings of the International Conference on Emerging Trends in Engineering, Science and Sustainable Technology, Karkala, India, 12 May 2017; pp. 95–99. [Google Scholar]
- Katarya, R.; Verma, O.P. An effective collaborative movie recommender system with cuckoo search. Egypt. Inform. J.
**2017**, 18, 105–112. [Google Scholar] [CrossRef][Green Version] - Katarya, R. Movie recommender system with metaheuristic artificial bee. Neural Comput. Appl.
**2018**, 30, 1983–1990. [Google Scholar] [CrossRef] - Katarya, R.; Verma, O.P. Effectual recommendations using artificial algae algorithm and fuzzy c-mean. Swarm Evol. Comput.
**2017**, 36, 52–61. [Google Scholar] [CrossRef] - Logesh, R.; Subramaniyaswamy, V.; Vijayakumar, V.; Gao, X.Z.; Indragandhi, V. A hybrid quantum-induced swarm intelligence clustering for the urban trip recommendation in smart city. Future Gener. Comput. Syst.
**2018**, 83, 653–673. [Google Scholar] [CrossRef] - Rana, C.; Jain, S.K. An evolutionary clustering algorithm based on temporal features for dynamic recommender systems. Swarm Evol. Comput.
**2014**, 14, 21–30. [Google Scholar] [CrossRef] - Chen, J.; Wang, H.; Yan, Z. Evolutionary heterogeneous clustering for rating prediction based on user collaborative filtering. Swarm Evol. Comput.
**2018**, 38, 35–41. [Google Scholar] [CrossRef] - Alam, S.; Dobbie, G.; Riddle, P.; Koh, Y.S. Hierarchical PSO clustering based recommender system. In Proceedings of the 2012 IEEE Congress on Evolutionary Computation, Brisbane, Australia, 10–15 June 2012; pp. 1–8. [Google Scholar]
- Marung, U.; Theera-Umpon, N.; Auephanwiriyakul, S. Top-N recommender systems using genetic algorithm-based visual-clustering methods. Symmetry
**2016**, 8, 54. [Google Scholar] [CrossRef][Green Version] - Barnard, C.J.; Sibly, R.M. Producers and scroungers: A general model and its application to captive flocks of house sparrows. Anim. Behav.
**1981**, 29, 543–550. [Google Scholar] [CrossRef] - Barta, Z.; Liker, A.; Mónus, F. The effects of predation risk on the use of social foraging tactics. Anim. Behav.
**2004**, 67, 301–308. [Google Scholar] [CrossRef] - Coolen, I.; Giraldeau, L.A.; Lavoie, M. Head position as an indicator of producer and scrounger tactics in a ground-feeding bird. Anim. Behav.
**2001**, 61, 895–903. [Google Scholar] [CrossRef][Green Version] - Koops, M.A.; Giraldeau, L.A. Producer–scrounger foraging games in starlings: A test of rate-maximizing and risk-sensitive models. Anim. Behav.
**1996**, 51, 773–783. [Google Scholar] [CrossRef][Green Version] - Liker, A.; Barta, Z. The effects of dominance on social foraging tactic use in house sparrows. Behaviour
**2002**, 139, 1061–1076. [Google Scholar] [CrossRef][Green Version] - Johnson, C.; Grant, J.W.; Giraldeau, L.A. The effect of handling time on interference among house sparrows foraging at different seed densities. Behaviour
**2001**, 138, 597–614. [Google Scholar] [CrossRef] - Bautista, L.M.; Alonso, J.C.; Alonso, J.A. Foraging site displacement in common crane flocks. Anim. Behav.
**1998**, 56, 1237–1243. [Google Scholar] [CrossRef][Green Version] - Lendvai, A.Z.; Barta, Z.; Liker, A.; Bókony, V. The effect of energy reserves on social foraging: Hungry sparrows scrounge more. Proc. R. Soc. Lond. Ser. B Biol.
**2004**, 271, 2467–2472. [Google Scholar] [CrossRef][Green Version] - Budgey, R.; Hutton, S. Three dimensional bird flock structure and its implications for birdstrike tolerence in aircraft. Proc. Int. Bird Strike Comm.
**1998**, 24, 307–320. [Google Scholar] - Pomeroy, H.; Heppner, F. Structure of turning in airborne rock dove (Columba livia) flocks. Auk
**1992**, 109, 256–267. [Google Scholar] - Hamilton, W.D. Geometry for the selfish herd. J. Theor. Biol.
**1971**, 31, 295–311. [Google Scholar] [CrossRef] - Pulliam, H.R. On the advantages of flocking. J. Theor. Biol.
**1973**, 38, 419–422. [Google Scholar] [CrossRef]

Movie #1 | Movie #2 | . | . | . | Movie #1682 | |
---|---|---|---|---|---|---|

User #1 | 0 | 3 | . | . | . | 0 |

User #2 | 4 | 0 | . | . | . | 2 |

. | . | . | . | . | . | . |

. | . | . | . | . | . | . |

. | . | . | . | . | . | . |

User #943 | 0 | 5 | . | . | . | 0 |

Movie #1 | Movie #2 | . | Movie #1682 | ||
---|---|---|---|---|---|

Sparrow #1 | Cluster-Head #1 | 2 | 3 | . | 3 |

Cluster-Head #2 | 3 | 1 | . | 5 | |

Cluster-Head #3 | 4 | 1 | . | 2 | |

. | . | . | . | . | . |

. | . | . | . | . | . |

Sparrow #20 | Cluster-Head #1 | 5 | 1 | . | 1 |

Cluster-Head #2 | 1 | 2 | . | 2 | |

Cluster-Head #3 | 2 | 4 | . | 4 |

**Table 3.**Sample of cluster assigned to each user in fittest sparrow (assuming that there are 3 clusters in each sparrow).

User #1 | User #2 | User #3 | . | User #943 | |
---|---|---|---|---|---|

Cluster # | 3 | 1 | 3 | . | 2 |

**Table 4.**Performance of sparrow-search recommender system based on different cluster size on MovieLens 100 k dataset.

S. No. | No. of Clusters (k) | MAE | SD | RMSE | t-Value | Recall | Precision |
---|---|---|---|---|---|---|---|

1 | 10 | 0.785 | 0.179 | 1.282 | 3.348 | 0.329 | 0.311 |

2 | 20 | 0.776 | 0.126 | 1.280 | 2.814 | 0.378 | 0.361 |

3 | 30 | 0.765 | 0.124 | 1.274 | 2.791 | 0.443 | 0.426 |

4 | 40 | 0.744 | 0.133 | 1.258 | 2.816 | 0.491 | 0.452 |

5 | 50 | 0.729 | 0.125 | 1.248 | 2.816 | 0.534 | 0.498 |

6 | 60 | 0.712 | 0.112 | 1.239 | 2.816 | 0.567 | 0.538 |

7 | 70 | 0.695 | 0.117 | 1.229 | 2.814 | 0.604 | 0.552 |

NMF | SVD | Firefly | Cuckoo | Whale | Sparrow | |
---|---|---|---|---|---|---|

MAE | 0.758 | 0.737 | 0.695 | 0.697 | 0.691 | 0.685 |

SD | 0.123 | 0.121 | 0.117 | 0.119 | 0.115 | 0.113 |

RMSE | 0.963 | 0.934 | 1.229 | 1.231 | 1.228 | 1.220 |

t-value | 2.818 | 2.816 | 2.814 | 2.816 | 2.811 | 2.792 |

Recall | 0.594 | 0.597 | 0.604 | 0.592 | 0.610 | 0.640 |

Precision | 0.546 | 0.549 | 0.552 | 0.554 | 0.560 | 0.602 |

NMF | SVD | Firefly | Cuckoo | Whale | Sparrow | |
---|---|---|---|---|---|---|

MAE | 0.724 | 0.686 | 0.664 | 0.678 | 0.660 | 0.654 |

SD | 0.123 | 0.121 | 0.117 | 0.119 | 0.115 | 0.113 |

RMSE | 0.916 | 0.873 | 0.852 | 0.862 | 0.857 | 0.841 |

t-value | 2.814 | 2.809 | 2.818 | 2.811 | 2.803 | 2.784 |

Recall | 0.602 | 0.614 | 0.638 | 0.622 | 0.648 | 0.673 |

Precision | 0.531 | 0.526 | 0.588 | 0.554 | 0.611 | 0.645 |

NMF | SVD | Firefly | Cuckoo | Whale | Sparrow | |
---|---|---|---|---|---|---|

MAE | 3.51 | 3.37 | 3.11 | 3.41 | 3.33 | 3.09 |

SD | 0.32 | 0.35 | 0.39 | 0.35 | 0.41 | 0.44 |

RMSE | 4.63 | 4.49 | 4.26 | 4.31 | 4.22 | 4.01 |

t-value | 3.11 | 3.04 | 2.98 | 3.02 | 2.96 | 2.91 |

Recall | 0.62 | 0.67 | 0.72 | 0.70 | 0.73 | 0.77 |

Precision | 0.68 | 0.69 | 0.74 | 0.71 | 0.74 | 0.78 |

NMF | SVD | Firefly | Cuckoo | Whale | Sparrow | |
---|---|---|---|---|---|---|

MAE | 1.06 | 0.96 | 0.87 | 0.91 | 0.84 | 0.78 |

SD | 0.28 | 0.31 | 0.35 | 0.32 | 0.36 | 0.39 |

RMSE | 1.38 | 1.26 | 1.15 | 1.23 | 1.10 | 1.02 |

t-value | 2.09 | 1.98 | 1.81 | 1.88 | 1.82 | 1.74 |

Recall | 0.65 | 0.69 | 0.74 | 0.71 | 0.74 | 0.76 |

Precision | 0.71 | 0.73 | 0.74 | 0.73 | 0.75 | 0.77 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Sharma, B.; Hashmi, A.; Gupta, C.; Khalaf, O.I.; Abdulsahib, G.M.; Itani, M.M. Hybrid Sparrow Clustered (HSC) Algorithm for Top-N Recommendation System. *Symmetry* **2022**, *14*, 793.
https://doi.org/10.3390/sym14040793

**AMA Style**

Sharma B, Hashmi A, Gupta C, Khalaf OI, Abdulsahib GM, Itani MM. Hybrid Sparrow Clustered (HSC) Algorithm for Top-N Recommendation System. *Symmetry*. 2022; 14(4):793.
https://doi.org/10.3390/sym14040793

**Chicago/Turabian Style**

Sharma, Bharti, Adeel Hashmi, Charu Gupta, Osamah Ibrahim Khalaf, Ghaida Muttashar Abdulsahib, and Malakeh Muhyiddeen Itani. 2022. "Hybrid Sparrow Clustered (HSC) Algorithm for Top-N Recommendation System" *Symmetry* 14, no. 4: 793.
https://doi.org/10.3390/sym14040793