Content-Based Recommendation Engine Using Term Frequency-Inverse Document Frequency Vectorization and Cosine Similarity: A Case Study
Ida Lumintu · 2023
This research presents a content-based recommendation engine powered by Term Frequency-Inverse Document Frequency (TF-IDF) vectorization to enhance personalized recommendations in e-commerce, aiming to improve the overall shopping experience. The methodology involves preprocessing text data, utilizing the TfidfVectorizer class to transform it into a TF-IDF matrix that captures word importance in product descriptions. Cosine similarity is then computed to identify similar products, generating personalized recommendations based on high similarity. Evaluation metrics show the engine's efficacy, achieving a precision of 1.0, recall of 1.0, F1-score of 1.0, and diversity of 0.4, indicating a balance between precision and recall. The study emphasizes the significance of TF-IDF vectorization in generating accurate recommendations from textual data. While limitations exist, such as reliance on text and room for improvement, future research directions include incorporating user feedback, contextual information, and advanced machine-learning techniques to enhance recommendation accuracy. In conclusion, this research contributes to recommendation systems by demonstrating the effectiveness of a content-based approach using TF-IDF. The proposed engine has the potential to enhance user experiences, providing personalized recommendations in ecommerce and increasing customer satisfaction and engagement.