Hybrid Collaborative Filtering-Based API Recommendation
Yongchao Wang,Yu Zhou,Taolue Chen,Jingxuan Zhang,Wenhua Yang,Zhiqiu Huang
DOI: https://doi.org/10.1109/qrs54544.2021.00100
2021-01-01
Abstract:Automatic API recommendations can liberate software developers from labor-intensive programming tasks. Collaborative filtering (CF) techniques, which have been proved to be superior to other classic techniques, are widely used in recommendation tasks such as music, book, and goods recommendations, but are rarely used in the recommendation of APIs. In this paper, we employ the hybrid of CF techniques to build an API recommendation system. More precisely, We treat the API recommendation task as an item recommendation problem, where method declarations are regarded as users, API calls are regarded as items. First, we use the memory-based CF technique to find the most similar projects, collect the most similar declarations, and take API calls used by the considered declarations together to generate a rating matrix. Next, we use the model-based CF technique to complete the missing values in the rating matrix, then a ranked list of APIs is generated based on the completed rating matrix and sent to the developers as a recommendation result. Experimental results show that compared with the state-of-the-art work, the proposed approach can achieve better performance in terms of a comprehensive set of metrics, such as Success Rate, Precision, Recall, MRR, and NDCG for the top-1, top-3 and top-5 recommended APIs.