0% found this document useful (0 votes)
18 views

Project Report CP 7th

Thhkk

Uploaded by

Aman Agarwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Project Report CP 7th

Thhkk

Uploaded by

Aman Agarwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Project Report

On

“Movie Recommendation System”

Submitted By:
Submitted To:
Harleen Kaur
Mr. Chandan
201302053
AIML Trainer
B.Tech CSE(AIML) 7th Sem

FACULTY OF ENGINEERING &


TECHNOLOGY

SGT UNIVERSITY, GURUGRAM

Session (2023-24)
TABLE OF CONTENTS

Candidate’s declaration..................................................................3

Acknowledgement.........................................................................4

Abstract..........................................................................................5

Introduction....................................................................................6

Literature Survey............................................................................8

Coding and implementation…………............................................9

References.....................................................................................17

Conclusion………………………................................................19
CANDIDATE’S DECLARATION

Certified that project work entitled “Movie recommendation System” is


a Bonafide work carried out in the 7th semester by Harleen Kaur roll no
201302053 in partial fulfilment for the award of Bachelor of Technology
in Computer Science and Engineering at Faculty of Engineering and
Technology from SGT University, Gurugram during the academic year
2023-2024 who carried out the project under the guidance of and no part
of this work has been submitted earlier for the award of B.Tech degree.

Harleen Kaur

201302053

BTech CSE(AIML)

4th Year/ 7th Semester

2020-2024
ACKNOWLEDGEMENT
Foremost of all, I express my sincere indebtedness to the “Almighty”, for
bestowing me with all the favorable circumstances and kept me in high spirits,
I am very great full to my advisor, “Harleen Kaur” for his patience,
encouragement, and many fruitful discussions from the very early stage of his
project. I would like to thank, Head of the Department of Computer Science
and Engineering. Faculty of Engineering and Technology from SGT
University, Gurugram. I wish to express my appreciation to my family for
my continuous love and encouragement, for always believing in me, for never
failing to provide all the support, and for coping with the pressure that
naturally comes with such endeavor.

Harleen Kaur

201302053

BTech CSE(AIML)

4th Year/ 7th Semester

2020-2024
ABSTRACT
The Intelligent Movie Recommendation System is an advanced digital platform
designed to enhance the movie-watching experience by providing personalized
and accurate movie recommendations to users. Leveraging cutting-edge machine
learning algorithms, user preferences, and content analysis, the system aims to
deliver tailored suggestions that align with individual tastes, ensuring an engaging
and enjoyable cinematic journey.
The core of the recommendation system involves a collaborative filtering
approach, where user behavior patterns are analyzed to identify similarities with
other users, leading to effective movie suggestions. Additionally, content-based
filtering is employed, taking into account the inherent characteristics of movies
such as genre, director, and cast to offer diverse and relevant recommendations.
The system also incorporates hybrid recommendation techniques, combining
collaborative and content-based filtering to overcome the limitations of each
approach and provide more robust and accurate suggestions. Through continuous
learning and adaptation, the system evolves with user feedback, ensuring that
recommendations stay up-to-date and reflective of changing preferences.
INTRODUCTION
In the ever-expanding world of digital entertainment, the abundance of available
movies often leaves viewers overwhelmed when deciding what to watch.
Recognizing this challenge, the Movie Recommendation System Project seeks to
revolutionize the way individuals discover and engage with films. By leveraging
advanced machine learning algorithms, data analytics, and user behavior analysis,
the project aims to provide a personalized and intuitive movie recommendation
experience.
The primary motivation behind this endeavor is to enhance user satisfaction and
streamline the movie selection process. Traditional methods of browsing through
extensive movie libraries or relying on generic recommendations often fall short
in catering to the diverse and unique preferences of individual viewers. In
response to this, the Movie Recommendation System utilizes sophisticated
techniques to understand user habits, preferences, and the intrinsic features of
movies, delivering tailored suggestions that align with each user's taste.
This project operates on the premise that effective movie recommendations go
beyond simple genre matching. It delves into collaborative filtering, where user
similarities are identified and used to suggest movies liked by users with similar
tastes. Additionally, content-based filtering considers the inherent characteristics
of movies, such as genre, director, and cast, to provide recommendations that
resonate with the viewer's preferences on a deeper level.
By incorporating hybrid recommendation techniques that synergize collaborative
and content-based filtering, the system addresses the limitations of individual
approaches, offering more accurate and diverse movie suggestions. The project
further establishes a dynamic feedback loop, allowing users to provide input on
recommended movies, ensuring continuous learning and refinement of the
recommendation algorithms.
As the Movie Recommendation System adapts to changing user preferences and
incorporates the latest advancements in machine learning, it aspires to become an
indispensable tool for movie enthusiasts. Through its innovative features and
commitment to delivering a personalized cinematic experience, this project
stands poised to redefine how users interact with the vast and ever-growing
landscape of digital entertainment.

Key Features:
 Personalized Recommendations: Utilizing user history, ratings, and
viewing habits to generate tailored movie suggestions.
 Collaborative Filtering: Analyzing user behavior to identify similarities
and recommend movies based on the preferences of like-minded users.

 Content-Based Filtering: Considering movie attributes such as genre,


director, and cast to provide recommendations that align with specific
tastes.

 Hybrid Recommendation Techniques: Combining collaborative and


content-based approaches for more accurate and diverse movie
suggestions.

 User Feedback Loop: Incorporating user feedback to continuously refine


the recommendation algorithms and adapt to evolving preferences.

 Scalability and Efficiency: Employing scalable and efficient algorithms


to handle large datasets, ensuring optimal performance even as the user
base grows.
LITERATURE SURVEY
A literature survey for a Movie Recommendation System project reveals a
comprehensive body of work that encompasses various techniques,
algorithms, and methodologies aimed at improving the accuracy and user
satisfaction of movie recommendations. Here's an overview of key findings
from the existing literature:
 Collaborative Filtering Techniques:
o User-Based Collaborative Filtering: Research has extensively
explored user-based collaborative filtering, where recommendations
are made based on the preferences and behaviors of similar users.
Different similarity metrics, such as cosine similarity and Pearson
correlation, have been employed to enhance accuracy.
o Item-Based Collaborative Filtering: This approach focuses on the
similarity between movies, recommending items that are similar to
those a user has shown interest in. Matrix factorization techniques,
such as Singular Value Decomposition (SVD) and Alternating Least
Squares (ALS), are commonly used for item-based collaborative
filtering.

 Content-Based Filtering and Feature Representation:


o Content-based filtering involves analyzing movie features such as
genre, director, and cast to make recommendations. Techniques for
effective feature representation, including natural language
processing for textual data, have been explored to improve the
understanding of movie content.

Real-time and Scalability:


With the growing scale of streaming platforms, research focuses on
developing real-time recommendation systems that can handle large
datasets efficiently. Scalable algorithms and distributed computing
approaches are considered to meet the demands of a vast user base.
CODING AND IMPLEMENTATIONS WITH OUTPUT

IMPORT LIBRARIES
We are first importing the libraries. Libraries like numpy, pandas, etc.

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 DATA PRE- PROCESSING

We are now saving the dataset that was taken from the Kaggle after loading the libraries.

# Store the data df


movies_data = pd.read_csv("movies.csv")

We are now displaying the dataset after saving it in the variable "df".

#Print the dataset


movies_data.head()

Now we are displaying the number of rows and columns-

#Display the number of rows and columns


movies_data.shape

(4803, 24)

As can be seen, there are a total of 4803 rows and 24 columns in the dataset.

#selecting relevant features

selected_feature = ['genres', 'director','tagline','keywords','cast']

selected_feature

['genres', 'director', 'tagline', 'keywords', 'cast']

# replacing null value with null string

for feature in selected_feature:

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

#combining selected features

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


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

combined_features.head()

0 Action Adventure Fantasy Science Fiction cultu...


1 Adventure Fantasy Action ocean drug abuse exot...
2 Action Adventure Crime spy based on novel secr...
3 Action Crime Drama Thriller dc comics crime fi...
4 Action Adventure Science Fiction based on nove...
dtype: object

#converting text data to feature vectors


vectorizer = TfidfVectorizer()

feature_vectors = vectorizer.fit_transform(combined_features)

print(feature_vectors)

(0, 2432) 0.17272411194153 (0, 7755) 0.1128035714854756 (0, 13024)


0.1942362060108871 (0, 10229) 0.16058685400095302 (0, 8756)
0.22709015857011816 (0, 14608) 0.15150672398763912 (0, 16668)
0.19843263965100372 (0, 14064) 0.20596090415084142 (0, 13319)
0.2177470539412484 (0, 17290) 0.20197912553916567 (0, 17007)
0.23643326319898797 (0, 13349) 0.15021264094167086 (0, 11503)
0.27211310056983656 (0, 11192) 0.09049319826481456 (0, 16998)
0.1282126322850579 (0, 15261) 0.07095833561276566 (0, 4945)
0.24025852494110758 (0, 14271) 0.21392179219912877 (0, 3225)
0.24960162956997736 (0, 16587) 0.12549432354918996 (0, 14378)
0.33962752210959823 (0, 5836) 0.1646750903586285 (0, 3065)
0.22208377802661425 (0, 3678) 0.21392179219912877 (0, 5437)
0.1036413987316636 : : (4801, 17266) 0.2886098184932947 (4801,
4835) 0.24713765026963996 (4801, 403) 0.17727585190343226 (4801, 6935)
0.2886098184932947 (4801, 11663) 0.21557500762727902 (4801, 1672)
0.1564793427630879 (4801, 10929) 0.13504166990041588 (4801, 7474)
0.11307961713172225 (4801, 3796) 0.3342808988877418 (4802, 6996)
0.5700048226105303 (4802, 5367) 0.22969114490410403 (4802, 3654)
0.262512960498006 (4802, 2425) 0.24002350969074696 (4802, 4608)
0.24002350969074696 (4802, 6417) 0.21753405888348784 (4802, 4371)
0.1538239182675544 (4802, 12989) 0.1696476532191718 (4802, 1316)
0.1960747079005741 (4802, 4528) 0.19504460807622875 (4802, 3436)
0.21753405888348784 (4802, 6155) 0.18056463596934083 (4802, 4980)
0.16078053641367315 (4802, 2129) 0.3099656128577656 (4802, 4518)
0.16784466610624255 (4802, 11161) 0.17867407682173203

COSINE SIMILARITY

#similarity score using cosine similarity

similarity = cosine_similarity(feature_vectors)

print(similarity)
[[1. 0.07219487 0.037733 ... 0. 0. 0. ] [0.07219487 1. 0.03281499 ... 0.03575545 0. 0. ] [0.037733
0.03281499 1. ... 0. 0.05389661 0. ] ... [0. 0.03575545 0. ... 1. 0. 0.02651502] [0. 0. 0.05389661 ... 0. 1. 0. ]
[0. 0. 0. ... 0.02651502 0. 1. ]]

similarity.shape
(4803, 4803)

#input from the user

movie_name = input("Enter the Movie Name:")


Enter the Movie Name:Avengers

#creating a list with all the movies name given in the data

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

print(list_of_all_titles)

#find the close match of the movies given by the user

find_close_match = difflib.get_close_matches(movie_name, list_of_all_titles)

find_close_match

['The Avengers', 'Swingers']

close_match = find_close_match[0]

close_match

‘The Avengers’

#find index of the movie


index_of_movie = movies_data[movies_data.title ==
close_match]['index'].values[0]

index_of_movie
16

#similar movies

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

print(similarity_score)

len(similarity_score)
4803

#sorting movies according to their similarity score

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


= True )

print(sorted_similar_movies)

#print 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 SYSTEM


movie_name = input("Enter the 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_movie = movies_data[movies_data.title ==
close_match]['index'].values[0]

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

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
TOOLS AND TECHNIQUES USED

MACHINE LEARNING
Machine Learning (ML) is a transformative field within the broader realm of
artificial intelligence (AI) that empowers computers to learn and improve from
experience without being explicitly programmed. The fundamental idea behind
machine learning is to enable systems to automatically recognize patterns, make
decisions, and improve their performance over time, all based on data.
Unlike traditional programming where explicit rules are defined to accomplish a
specific task, machine learning algorithms use statistical techniques to allow
computers to learn from data and make predictions or decisions without explicit
programming. This ability to learn and adapt is what distinguishes machine
learning from conventional programming approaches.
Machine learning applications span a wide range of domains, from image and
speech recognition to natural language processing, recommendation systems, and
autonomous vehicles. As technology advances, the impact and ubiquity of
machine learning continue to grow, making it a central component of modern AI-
driven systems.

FEATURE SCALING
Feature scaling is a crucial preprocessing step in many machine learning
algorithms, especially those that are sensitive to the scale of input features.
Scaling ensures that the features contribute equally to the model training process,
preventing certain features from dominating due to their larger magnitudes. Two
common techniques for feature scaling in AI are Min-Max Scaling and
Standardization (Z-score normalization).
 Min-Max Scaling:
o Min-Max Scaling, also known as normalization, involves
transforming the values of features to a specific range, typically
between 0 and 1. The formula for Min-Max Scaling is given by:
o Xnew=(X−Xmin)/(Xmax−Xmin)
o Here, X is the original value, Xmin is the minimum value of the
feature, and max is the maximum value of the feature.
o Min-Max Scaling is beneficial when the features have different
ranges, and it is important to bring them to a common scale. It is
particularly useful for algorithms that rely on distances, such as k-
nearest neighbors.
 Standardization (Z-score normalization):
o Standardization transforms the values of features to have a mean of
0 and a standard deviation of 1. The formula for standardization is
given by:
Xnew =(X−μ)/ σ
o Here, X is the original value, μ is the mean of the feature, and σ is
the standard deviation of the feature.
o Standardization is useful when the features follow a Gaussian
distribution (normal distribution) and the algorithm relies on the
assumption of normality, such as many linear models.
Choosing between Min-Max Scaling and Standardization depends on the
characteristics of the data and the requirements of the specific machine learning
algorithm being used. Some algorithms, like support vector machines and k-
means clustering, may benefit more from standardization, while others, like
neural networks, might perform well with Min-Max Scaling.
REFERENCE

 Kaggle
 Geeksforgeeks
 github
CONCLUSION
In conclusion, the Movie Recommendation System project represents a
significant step towards enhancing the user experience in the vast and diverse
realm of digital entertainment. Through an exploration of diverse
recommendation techniques and a synthesis of collaborative, content-based, and
hybrid models, the project seeks to address the intricate challenge of providing
personalized and relevant movie suggestions.

The incorporation of collaborative filtering techniques, leveraging both user-


based and item-based approaches, aims to capture the nuances of user preferences
by considering similarities between users and movies. Content-based filtering
enriches recommendations by analyzing inherent movie attributes, contributing
to a more comprehensive understanding of user tastes.

The adoption of hybrid models reflects an acknowledgment of the strengths and


limitations of individual recommendation techniques. By combining
collaborative and content-based approaches, the project aspires to deliver a
recommendation system that is robust, accurate, and capable of providing a
diverse set of movie suggestions.

Deep learning methodologies, particularly neural networks, represent a forward-


looking aspect of the project. The integration of these advanced techniques is
anticipated to capture intricate patterns in user behavior and movie features,
contributing to more sophisticated and adaptive recommendation algorithms.

The emphasis on context-aware recommendations demonstrates a commitment to


providing suggestions that align with the dynamic and evolving nature of user
preferences. Considering contextual factors such as time, location, and user mood
enhances the relevance and timeliness of the movie recommendations.

As the project navigates challenges such as the "cold start" problem, scalability,
and the need for diversity in suggestions, it aligns with the broader trends in
recommendation system research. The commitment to user-centric evaluation
metrics ensures that the project's success is measured by its ability to meet the
practical needs and expectations of its audience.

In the ever-evolving landscape of digital entertainment, the Movie


Recommendation System project not only contributes to the existing body of
knowledge but also reflects a commitment to creating a personalized and
enriching cinematic experience for users. As technology continues to advance,
and user preferences evolve, this project sets the stage for the ongoing evolution
of recommendation systems, paving the way for more intelligent, adaptive, and
user-focused platforms in the future.

You might also like