You are on page 1of 24

RECOMMENDATION SYSTEMS USING

MACHINE LEARNING

A MINI-PROJECT REPORT

Submitted by

SHARATH J [410720104063]
MANOJ KUMAR S [410720104041]
NESAMANI K [410720104046]
KALYANRAJ S [410720104303]

in partial fulfillment for the award of the degree of


BACHELOR OF TECHNOLOGY
IN
ARTIFICIAL INTELLIGENCE AND DATA SCIENCE

DHANALAKSHMI COLLEGE OF ENGINEERING

ANNA UNIVERSITY: CHENNAI 600 025


JANUARY 2023

PAGE \* MERGEFORMAT 1
ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “RECOMMENDATION SYSTEM


USING MACHINE LEARNING” is the Bonafide work of
“SHARATH J(410720104063), MANOJ KUMAR S(410720104041),
NESAMANI K(410720104046), KALYANRAJ S(410720104303)”
who carried out the project work under my supervision.

SIGNATURE SIGNATURE

Computer science And Engineering, Mr.K.PANDIKUMAR


Dhanalakshmi College of Engineering M.E.,Ph.d.,
PROJECT SUPERVISOR
Dr. VPR Nagar ,Manimangalam, ASSISTANT PROFESSOR
Chennai-601 301. Computer Science And Engineering,
Dhanalakshmi College of Engineering
Dr. VPR Nagar ,Manimangalam,
Chennai-601 301.

PAGE \* MERGEFORMAT 9
CERTIFICATE OF EVALUATION

College Name : 4107 – Dhanalakshmi College of Engineering

Branch & Semester : Computer Science And Engineering

Semester : 6th

Subject :

S.NO NAME OF THE TITLE OF THE NAME OF THE


STUDENT PROJECT SUPERVISOR
WITH
DESIGNATION
SHARATH J
1. (410720104063)

MANOJ KUMAR S RECOMMENDATION


2. (410720104041) SYSTEM USING
MACHINE LEARNING
NESAMANI K
3. (410720104046)

KALYAN RAJ S
4. (410720104303)

The report of the project work submitted by the above students in partial
fulfillment for the award of a Bachelor of Technology degree in COMPUTER
SCIENCE AND ENGINEERING under Anna University was evaluated and
confirmed to be the reports about the work done by the above students.

Submitted for the mini project viva-voce examination held at Dhanalakshmi


College of Engineering on

INTERNAL EXAMINER EXTERNAL EXAMINER

PAGE \* MERGEFORMAT 9
ACKNOWLEDGEMENT

We express our heartfelt thanks to our honorable Founder and


Chairman Dr.V.P.Ramamurthi, Ph.D., Dhanalakshmi College of
Engineering, for guiding us and permitting us to do our project on our
own.

We express our sincere gratitude and wish to thank our beloved


Principal, Dr. C. Ramesh Babu Durai, B.E, M.E, Ph.D., for his
support and guidance.

We extend our gratitude and heartfelt thanks to the Head of the

Department, ………………………
for guiding us in all aspects of our project in each stage and providing us
with valuable suggestions.

We would like to thank at most to our Project Supervisor,


……………………………………..who rendered valuable guidance
and full support always.

Finally, we take this opportunity to thank all the faculty members of


the Department of Computer Science And Engineering for their
unwavering support and cooperation which made us keep our zeal and
spirits high to complete this project work successfully.

PAGE \* MERGEFORMAT 9
ABSTRACT

A recommendation system could be an information filtering technique. They


won’t offer suggestions to the users in step with their interest and wish. It's an
in-style technique in recent years and utilized by several e-commercial websites
and alternative platforms to suggest news, books, movies, looking things,
novels, music, and far a lot of that's why recommendation system has become a
hot topic. Recommendation systems are a unit that set information filtering
systems. Different the varied sorts of recommendation systems are a unit
employed in different platforms and became a crucial part of various
applications. It's a call-creating method White hat facilitates the users to shop
for things in which they're interested.

Recommendation systems are a helpful and effective technique for filtering the
info. This paper could be a review of advice systems which will describe
recommendation systems; however, it works and helps in several platforms, and
also the different kinds of it with their deserves and limitations

PAGE \* MERGEFORMAT 9
TABLE OF CONTENT

CHAPTER TITLE PG
NO. NO.

ABSTRACT V
LIST OF FIGURES VII

1 INTRODUCTION 1
1.1 OBJECTIVE 2
1.2 APPLICATION 2

2 LITERATURE
2.1 LITERATURE REVIEW 3
2.2 RELATED WORKS IN THE 4
RECOMMENDATION SYSTEMS

3 DEVELOPMENT PROCESS
3.1 ARCHITECTURE 7
3.2 WORK FLOW 8
3.3 METHODS OF RECOMMENDATION SYSTEM 8

4 TYPES OF RECOMMENDATION SYSTEM 9

5 CONCLUSION 11
APPENDICES
SAMPLE CODE 12
5.1 SAMPLE OUTPUT 16

6 REFERENCES 17

PAGE \* MERGEFORMAT 9
LIST OF FIGURE

FIGURE TITLE PG
NO. NO.

3.1 SYSTEM ARCHITECTURE 7


3.2 WORK FLOW 8
3.3 METHODS OF RECOMMENDATION SYSTEM 8

5.1 O/P OF WORKING APPLICATION 16

PAGE \* MERGEFORMAT 9
CHAPTER : 1

INTRODUCTION

Personalization and recommendation systems are currently deployed for a


variety of tasks at large internet companies, including ad click-through rate
(CTR) prediction and rankings. Although these methods have had long
histories, these approaches have only recently embraced neural networks. Two
primary perspectives contributed to the architectural design of deep learning
models for personalization and recommendation. The first comes from the view
of recommendation systems. These systems initially employed content filtering
where a set of experts classified products, while users selected their preferred
categories and were matched based on their preferences

The field subsequently evolved to use collaborative filtering, where


recommendations are based on past user behaviors, such as prior ratings given
to products. Neighborhood methods that provide recommendations by grouping
users and products together and latent factor methods that characterize users and
products by certain implicit factors via matrix factorization techniques were
later deployed with success.

The second view comes from predictive analytics, which relies on


statistical models to classify or predict the probability of events based on the
given data. Predictive models shifted from using simple models such as linear
and logistic regression to models that incorporate deep networks. To process
categorical data, these models adopted the use of embedding, which transforms
the one- and multi-hot vectors into dense representations in an abstract space.
This abstract space may be interpreted as the space of the latent factors found by
recommendation systems.

1
1.1 OBJECTIVE :

To perform a Re-commendation System using Machine Learning

1.2 APPLICATION :

The application of recommender systems is wide-ranging with them being used


by companies to recommend movies, music, learning materials, television
programs, books, documents, houses, business partners, websites, conferences,
tourism scenic spots, products, financial services, learning materials, etc.

Movie recommendation systems use a set of different filtration strategies and


algorithms to help users find the most relevant films.

The most popular categories of ML algorithms used for movie


recommendations include

- Content-based filtering and


- Collaborative filtering systems.

2
CHAPTER 2
LITERATURE
2.1 LITERATURE REVIEW :
Recommender systems have become an important research field
since the emergence of the first paper on collaborative filtering in the
mid-1990s.
In general, recommender systems are defined as the supporting
systems which help users to find information, products, or services (such
as books, movies, music, digital products, websites, and TV programs)
by aggregating and analyzing suggestions from other users, which mean
reviews from various authorities, and user attributes. However, as
academic research on recommender systems has increased significantly
over the last ten years, more research is required to be applicable in a
real-world situation.
Because the research field on recommender systems is still wide
and less mature than other research fields. Accordingly, the existing
articles on recommender systems need to be reviewed for the next
generation of recommender systems. However, it would be not easy to
confine the recommender system researches to specific disciplines,
considering the nature of the recommender system researches. So, we
reviewed all articles on recommender systems from 37 journals that
were published from 2001 to 2010. The 37 journals are selected from the
top 125 journals of the MIS Journal Rankings. Also, the literature search
was based on the descriptors "Recommender system",
"Recommendation system", "Personalization system", "Collaborative
filtering" and "Contents filtering".
The full text of each article was reviewed to eliminate the article
that was not related to recommender systems. Many articles were
excluded because articles such as Conference papers, master's and
doctoral dissertations, textbooks, unpublished working papers, non-
English publication papers, and news were unfit for our research. We
classified articles by year of publication, journals, recommendation
fields, and data mining techniques. The recommendation fields and data
mining techniques of 187 articles are reviewed and classified into eight
recommendation fields (book, document, image, movie, music,
shopping, TV program, and others) and eight data mining techniques
(association rule, clustering, decision tree, k-nearest neighbor, link
analysis, neural network, regression, and other heuristic methods). The
3
results represented in this paper have several significant implications.
First, based on previous publication rates, the interest in recommender
system-related research will grow significantly in the future. Second, 49
articles are related to movie recommendations whereas image and TV
program recommendations are identified in only 6 articles. This result
has been caused by the easy use of the Movie Lens data set. So, it is
necessary to prepare a data set of other fields. Third, recently social
network analysis has been used in various applications. However,
studies on recommender systems using social network analysis are
deficient. Henceforth, we expect that new recommendation approaches
using social network analysis will be developed in the recommender
systems. So, it will be an interesting and further research area to
evaluate the recommendation system research using social method
analysis. This result provides a trend of recommender system research
by examining the published literature and provides practitioners and
researchers with insight and future direction on recommender systems.
We hope that this research helps anyone interested in recommender
systems research to gain insight for future research.

2.2 RELATED WORKS IN THE RECOMMENDATION SYSTEMS :

Recommender systems are used in a variety of areas, with commonly


recognized examples taking the form of playlist generators for video and music
services, product recommenders for online stores, content recommenders for
social media platforms, and open web content recommenders. These systems
can operate using a single input, like music, or multiple inputs within and across
platforms like news, books, and search queries. There are also popular
recommender systems for specific topics like restaurants and online dating.
Recommender systems have also been developed to explore research articles
and experts, collaborators, and financial services.

A recommender system is defined as a decision-making strategy for users


in complex information environments. Also, the recommender system was
defined from the perspective of E-commerce as a tool that helps users search
through records of knowledge that are related to users’ interests and
preferences. The recommender system was defined as a means of assisting and
augmenting the social process of using recommendations of others to make
choices when there is no sufficient personal knowledge or experience of the
alternatives. Recommender systems handle the problem of information overload
that users normally encounter by providing them with personalized, exclusive
content and service recommendations.

4
Recently, various approaches for building recommendation systems have
been developed, which can utilize either collaborative filtering, content-based
filtering, or hybrid filtering. The collaborative filtering technique is the most
mature and most commonly implemented.

Collaborative filtering recommends items by identifying other users with


similar tastes; it uses their opinion to recommend items to the active user.
Collaborative recommender systems have been implemented in different
application areas. Group Lens is a news-based architecture that employed
collaborative methods in assisting users to locate articles from a massive news
database. Ringo is an online social information filtering system that uses
collaborative filtering to build users’ profiles based on their ratings on music
albums.
Amazon uses topic diversification algorithms to improve its
recommendation. The system uses a collaborative filtering method to overcome
scalability issues by generating a table of similar items offline through the use
of an item-to-item matrix. The system then recommends other products which
are similar online according to the users’ purchase history. On the other hand,
content-based techniques match content resources to user characteristics.
Content-based filtering techniques normally base their predictions on users’
information, and they ignore contributions from other users as in the case of
collaborative techniques. Fab relies heavily on the ratings of different users
intoreate a training set and it is an example of a content-based recommender
system. Some other systems that use content-based filtering to help users find
information on the Internet include Letizia.

The system makes use of a user interface that assists users in browsing
the Internet; it can track the browsing pattern of a user to predict the pages that
they may be interested in. Pazzan. Designed an intelligent agent that attempts to
predict which web pages will interest a user by using a naive Bayesian
classifier. The agent allows a user to provide training instances by rating
different pages as either hot or cold. Jennings and Higuchi describe a neural
network that models the interests of a user in a Usenet news environment.

5
Movie/Book/News Recommendations - Suggest new content that increases
user engagement. The aim is to introduce users to new content that may interest
them and encourage them to consume more content on our platform.

Stock Recommendations - Suggest stocks that are most profitable to the


clients. The recommendations may be stocks that they have traded in
historically. Novelty does not matter here; the profitability of the stock does.

Product Recommendations - Suggest a mix of old and new products. The old
products from users’ historical transactions serve as a reminder of their frequent
purchases. Also, it is important to suggest new products that the users
may like to try.

6
CHAPTER 3

DEVELOPMENT PROCESS

3.1 ARCHITECTURE :

Figure 3.1

7
3.2 WORK FLOW :

Figure 3.2

3.3 METHODS OF RECOMMENDATION SYSTEM :

Figure 3.

8
CHAPTER 4

TYPES OF RECOMMENDATION SYSTEM

CONTENT BASED FILTERING :

The content-based technique is a domain-dependent algorithm and it


emphasizes more on the analysis of the attributes of items to generate
predictions. When documents such as web pages, publications, and news are to
be recommended, the content-based filtering technique is the most successful.
In the content-based filtering technique, the recommendation is made based on
the user profiles using features extracted from the content of the items the user
has evaluated in the past. Items that are mostly related to the positively rated
items are recommended to the user. CBF uses different types of models to find
similarities between documents to generate meaningful recommendations.

It could use Vector Space Model such as Term Frequency Inverse


Document Frequency (TF/IDF) or Probabilistic models such as Naïve Bayes
Classifier, Decision Trees, or Neural Networks to model the relationship
between different documents within a corpus. These techniques make
recommendations by learning the underlying model with either statistical
analysis or machine learning techniques. Content-based filtering technique does
not need the profile of other users since they do not influence the
recommendations. Also, if the user profile changes, the CBF technique still has
the potential to adjust its recommendations within a very short period. The
major disadvantage of this technique is the need to have in-depth knowledge
and description of the features of the items in the profile

COLLABORATIVE FILTERING :

Collaborative filtering is a domain-independent prediction technique for


content that cannot easily and adequately be described by metadata such as
movies and music. The collaborative filtering technique works by building a
database (user-item matrix) of preferences for items by users. It then matches
users with relevant interests and preferences by calculating similarities between
their profiles to make recommendations. Such users build a group called a
neighborhood. A user gets recommendations for those items that he has not
rated before but that were already positively rated by users in his neighborhood.
Recommendations that are produced by CF can be of either prediction or
recommendation. Prediction is a numerical value, expressing the predicted score
of item j for user I, while Recommendation is a list of the top N items that the
user will like the most. The technique of collaborative filtering can be divided
into two categories: memory-based and model-based.

9
HYBRID FILTERING :

The hybrid filtering technique combines different recommendation


techniques to gain better system optimization to avoid some limitations and
problems of pure recommendation systems. The idea behind hybrid techniques
is that a combination of algorithms will provide more accurate and effective
recommendations than a single algorithm as the disadvantages of one algorithm
can be overcome by another algorithm. Using multiple recommendation
techniques can suppress the weaknesses of an individual technique in a
combined model. The combination of approaches can be done in any of the
following ways: separate implementation of algorithms and combining the
result, utilizing some content-based filtering in a collaborative approach,
utilizing some collaborative filtering in a content-based approach, and creating a
unified recommendation system that brings together both approaches.

10
CHAPTER : 5

CONCLUSION

Recommender systems open new opportunities for retrieving


personalized information on the Internet. It also helps to alleviate the problem
of information overload which is a very common phenomenon with information
retrieval systems and enables users to have access to products and services
which are not readily available to users on the system. This paper discussed the
two traditional recommendation techniques and highlighted their strengths and
challenges with diverse kinds of hybridization strategies used to improve their
performances. Various learning algorithms used in generating recommendation
models and evaluation metrics used in measuring the quality and performance
of recommendation algorithms were discussed. This knowledge will
empower researchers and serve as a road map to improve state-of-the-art
recommendation techniques.

11
APPENDICES

SAMPLE CODE

Importing the dependencies

import numpy as np
import pandas as pd
import difflib
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity

"""Data Collection and Pre-Processing"""

# loading the data from the csv file to apandas dataframe


movies_data = pd.read_csv('/content/movies.csv')

# printing the first 5 rows of the dataframe


movies_data.head()

# number of rows and columns in the data frame

movies_data.shape

# selecting the relevant features for recommendation

selected_features = ['genres','keywords','tagline','cast','director']
print(selected_features)

# replacing the null valuess with null string

for feature in selected_features:


movies_data[feature] = movies_data[feature].fillna('')

# combining all the 5 selected features

combined_features = movies_data['genres']+' '+movies_data['keywords']+'


'+movies_data['tagline']+' '+movies_data['cast']+'
'+movies_data['director']

print(combined_features)

12
# converting the text data to feature vectors

vectorizer = TfidfVectorizer()

feature_vectors = vectorizer.fit_transform(combined_features)

print(feature_vectors)

"""Cosine Similarity"""

# getting the similarity scores using cosine similarity

similarity = cosine_similarity(feature_vectors)

print(similarity)

print(similarity.shape)

"""Getting the movie name from the user"""

# getting the movie name from the user

movie_name = input(' Enter your favourite movie name : ')

# creating a list with all the movie names given in the dataset

list_of_all_titles = movies_data['title'].tolist()
print(list_of_all_titles)

# finding the close match for the movie name given by the user

find_close_match = difflib.get_close_matches(movie_name,
list_of_all_titles)
print(find_close_match)

close_match = find_close_match[0]
print(close_match)

# finding the index of the movie with title

index_of_the_movie = movies_data[movies_data.title == close_match]


['index'].values[0]
print(index_of_the_movie)

13
# getting a list of similar movies

similarity_score = list(enumerate(similarity[index_of_the_movie]))
print(similarity_score)

len(similarity_score)

# sorting the movies based on their similarity score

sorted_similar_movies = sorted(similarity_score, key = lambda x:x[1],


reverse = True)
print(sorted_similar_movies)

# print the name of similar movies based on the index

print('Movies suggested for you : \n')

i=1

for movie in sorted_similar_movies:


index = movie[0]
title_from_index = movies_data[movies_data.index==index]
['title'].values[0]
if (i<30):
print(i, '.',title_from_index)
i+=1

"""Movie Recommendation Sytem"""

movie_name = input(' Enter your favourite movie name : ')

list_of_all_titles = movies_data['title'].tolist()

find_close_match = difflib.get_close_matches(movie_name,
list_of_all_titles)

close_match = find_close_match[0]

index_of_the_movie = movies_data[movies_data.title == close_match]


['index'].values[0]

similarity_score = list(enumerate(similarity[index_of_the_movie]))

14
sorted_similar_movies = sorted(similarity_score, key = lambda x:x[1],
reverse = True)

print('Movies suggested for you : \n')

i=1

for movie in sorted_similar_movies:


index = movie[0]
title_from_index = movies_data[movies_data.index==index]
['title'].values[0]
if (i<30):
print(i, '.',title_from_index)
i+=1

15
5.1 SAMPLE OUTPUT :

16
CHAPTER : 6

REFERENCE

[1] Recommender Systems: An overview of different Approaches to


recommendations Kunal Shah, Akshaykumar Salunke, Saurabh Dongare,
Kisandas Antala SIT, Lonavala India 2017

[2] A Case-Based Recommendation Approach for Market Basket Data Anna


Gatzioura and Miquel Snchez-Marr IEEE INTELLIGENT SYSTEMS 2015.

[3] Recommendation analysis on Item-based and User-based Collaboration


Filtering Garima Gupta, Rahul Katarya, India

[4] Recommender systems, Handbook, Francesso Ricci, Lior Rokach, Bracha


Shapira, Paul B. Kantor. Springer 2010.

[5] Using collaborative filtering to weave information Tapestry D. Goldberg, D.


Nichols, B. M. Oki, and D. Terry, Communications of the ACM, vol. 35, no.
12, pp. 6170,1992

[6] Zhao, Zhi-DaXn, and Ming-Sheng Shang. “User-based collaborative


filtering recommendation algorithms on Hadoop.” In 2010 Third International
Conference on Knowledge Discovery and Data Mining, pp. 478-481.IEEE,
2010

[7] P. W. Yau and A. Tomlinson, “Towards Privacy in a Context-Aware Social


Network Based Recommendation System,” Privacy, Security, Risk and Trust
(PASSAT) and 2011 IEEE Third International Conference on Social Computing
(SocialCom), 2011 IEEE Third International Conference

[8] K. Goldberg, T. Roeder, D. Gupta, and C. Perkins. Eigentaste: A


constant time collaborative filtering algorithm. Information Retrieval,
4(2):133-151, 2001. (Pubitemid 33636930)

17

You might also like