Dipesh Shrestha 1 PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

CU6051NI Artificial Intelligence

Module Code & Module Title


CU6051NI - Artificial Intelligence

Assessment Weightage & Type


75% Individual Coursework

Year and Semester 2020-21


Autumn

Student Name: Dipesh Shrestha


London Met ID: 18030022
College ID: NP01CP4A180194
Assignment Due Date: 25th Jul
Assignment Submission Date: 25th Jul

I confirm that I understand my coursework needs to be submitted online via Google Classroom under the
relevant module page before the deadline in order for my assignment to be accepted and marked. I am
fully aware that late submissions will be treated as non-submission and a marks of zero will be awarded.
CU6051NI Artificial Intelligence

Table of Contents
Introduction........................................................................................................................1
Explanation of the topic related.....................................................................................1
Problem domain.............................................................................................................2
Explanation of the chosen topic.....................................................................................3
Background.......................................................................................................................4
Research on the topic....................................................................................................4
Research in similar topics..............................................................................................6
Solution..............................................................................................................................9
Explanation of proposed solution..................................................................................9
Explanation of algorithm used:......................................................................................9
Pseudocode of the solution.........................................................................................13
Diagrammatical Representation......................................................................................14
Flow chart....................................................................................................................14
State transition Diagram..............................................................................................15
Explanation of the development process........................................................................16
Achieved Results.............................................................................................................17
Conclusion.......................................................................................................................23
Analysis of the work.....................................................................................................23
Address to real world problem.....................................................................................24
Further work.................................................................................................................24
References......................................................................................................................25

Dipesh Shrestha 18030022


CU6051NI Artificial Intelligence

Table of Figures

Figure 1 Filtering................................................................................................................4
Figure 2 Machine Learning................................................................................................5
Figure 3 Collaborating filter..............................................................................................10
Figure 4 User based collaborative filtering......................................................................11
Figure 5 Item based collaborative filtering.......................................................................12
Figure 6 Flow Chart.........................................................................................................14
Figure 7 state transition diagram.....................................................................................15
Figure 8............................................................................................................................17
Figure 9............................................................................................................................18
Figure 10..........................................................................................................................18
Figure 11..........................................................................................................................19
Figure 12..........................................................................................................................20
Figure 13..........................................................................................................................20
Figure 14..........................................................................................................................21
Figure 15..........................................................................................................................21
Figure 16..........................................................................................................................21
Figure 17..........................................................................................................................22

Dipesh Shrestha 18030022


CU6051NI Artificial Intelligence

Introduction

As online companies and stores grow, the usage of recommendation systems


has become increasingly important in the e-commerce industry. The finest
examples of recommendation systems are all of the online movie and series
platforms that use the phrase "movies you might enjoy." The AI in the
recommendation engine allows it to produce faster and more efficient
recommendations based on the requirements and preferences of each user.
Artificial intelligence is also advancing internet searches, since it offers
recommendations based on users' visual tastes rather than a product
description. AI engines are likely to become search field substitutes, as they
assist consumers in finding items or content in ways never seen before. As a
result, sites like Amazon, Facebook, Spotify, YouTube, and others rely heavily on
recommendation algorithms today.

Explanation of the topic related

“The science and engineering of making intelligent machines especially intelligent


computer programs”. – John McCarthy- [CITATION Bei18 \l 1033 ]

Artificial Intelligence (AI) is a method of making a computer, a robot, or a product


think like a person. When there is a problem, AI is the study of how a human mind
thinks, learns, decides, and executes the task. As a result, an intelligent software
system emerges. The goal of AI is to increase computer functions linked to human
learning and problem solving.

Dipesh Shrestha 18030022 1


CU6051NI Artificial Intelligence

The intelligence is imperceptible. It contains:

• Reasoning
• Learning
• Problem solving
• Perception
• Linguistic intelligence [ CITATION Bei18 \l 1033 ]

Perception, knowledge description, preparation, learning, natural language


processing, comprehension, and the capacity to move and control objects are all
areas of AI study. [ CITATION Bei18 \l 1033 ]

Problem domain

We are currently living in an "age of abundance." We have hundreds of


alternatives to select from for every product on the market. Take, for example,
social networking and internet shopping; the list goes on and on. The
recommendation system aids in personalizing a stage and assisting users in
finding what they enjoy.

Choosing a movie to see with friends on a night out may be difficult, and a lot of
time is wasted doing so. A user may view a film simply by looking at its cover or
narrative. Most of the time, the user starts viewing a movie and realizes halfway
through that it is a waste of time. Getting a suggestion from a friend may be quite
annoying since your taste in movies may differ from that of others. I want to create
a solution to this problem by developing a movie recommendation system.

Dipesh Shrestha 18030022 2


CU6051NI Artificial Intelligence

Explanation of the chosen topic

Movie Recommendation System

Everybody loves to watch movies irrespective their age, gender, race, color and so
on. The most exciting fact is that how unique our selections and mixtures are in
terms of movies likings. A recommendation system is a filtration program whose
goal is to predict the ratings of a user towards a domain specific product or item. In
our case, the domain specific item is a movie, that is why the main focus of
recommendation system is to predict the movies which a user would prefer given
some user data.

Dipesh Shrestha 18030022 3


CU6051NI Artificial Intelligence

Background

Research on the topic

Recommendation system

A recommendation system is a data filtering system that anticipates the user's


priorities and makes suggestions based on the information provided. Often, these
sorts of systems may extract and filter data about a user's preferences, and then
utilize that information to develop recommendations for the days ahead. The
suggestion system is an excellent marketing tool, particularly for e-commerce, and
it may also help increase sales and income. It must be adaptable to new user
activities to be helpful. It should be able to operate in a variety of environments
while giving users with timely information. [ CITATION Vis18 \l 1033 ]

Figure 1 Filtering

Dipesh Shrestha 18030022 4


CU6051NI Artificial Intelligence

Machine Learning

There are two types of machine learning algorithms used in recommendation


systems: collaborative and content-based filtering. Modern recommendation
systems, on the other hand, integrate the two. Collaboration techniques quantify
similarity from consumer contacts, whereas content-based filtering examines the
similarity of product features. The goal of machine learning is to create a function
that predicts the utility of things in relation to one another[ CITATION Rod19 \l
1033 ]

With so much information on the internet and so many people utilizing it, it's
become critical for businesses to search for and offer data to their consumers
based on their needs and preferences. [ CITATION Rod19 \l 1033 ]

Dipesh Shrestha 18030022 5


CU6051NI Artificial Intelligence

Figure 2 Machine Learning

Research in similar topics

Many recommendation systems have been created that use collaborative, content-
based, or hybrid filtering approaches. These systems were built utilizing a variety
of big data and machine learning techniques.

Netflix recommending movie

Netflix ratings were subjected to recommendation system approaches. Many user


ratings on a 1-5 Likert scale for various movies are included in the data. The
objective is to suggest movies to people who have not seen them yet. We begin

Dipesh Shrestha 18030022 6


CU6051NI Artificial Intelligence

with a basic introduction and describe current work in this subject, followed by a
data preparation part in which we show how to extend the original data with
characteristics obtained from IMDb. As approaches for a recommender system,
we will examine collaborative filtering (item-based, user-based, and single value
decomposition), content-based filtering, and hybrid filtering. After evaluating, the
singular value decomposition model came out as the most suitable model for this
dataset[ CITATION Ste18 \l 1033 ]

Spotify recommending music

Spotify recommends music using three different types of models. Natural


Language Processing (NLP) models are the first. These compare songs based on
terms used to describe them in places like articles on the internet. The following is
used to suggest songs that aren't as well-known. These Content-Based models
analyze the audio and utilize similarities to suggest songs that are similar to your
current selection. Collaborative Filtering is the last method. What it essentially
does is create a user vector for each user and a song vector for each song. It then
compares them in order to suggest music that is similar to each other as well as
music that comparable people enjoy. I will talk about Collaborative Filtering
throughout this article because it's the most popular and is at the heart of Spotify's

Dipesh Shrestha 18030022 7


CU6051NI Artificial Intelligence

most popular music selection method: Discover Weekly. This method, and more
especially how linear algebra is utilized to power it, will be the subject of my
research. It should be mentioned that other firms, such as Last.fm, utilize a similar
concept to Spotify's, while the Netflix Prize promoted another. I'll be focusing only
on Spotify's Collaborative Filtering technique, which varies from Netflix's in that it
employs implicit input rather than explicit feedback like as ratings and other explicit
user data. It should also be noted that this is my interpretation of Spotify's
Collaborative Filtering based on my study, and it is highly unlikely to be accurate.
[ CITATION Sor19 \l 1033 ]

Amazon recommending products

Customers' browsing history allows Amazon to keep the appropriate goods in front
of their eyes. Based on the use of user evaluations and ratings, it recommends
and sells the best-selling choice. Instead of selling you a product, Amazon is more
likely to sell you a box. Assume you've purchased an earring; it will then
recommend a matching necklace and bracelet. After that, it sends you an email
using a recommendation engine to keep you informed about new trends in that
area. Amazon also utilizes recommendations in email campaigns and website
pages for targeted marketing. As a result, Amazon begins proposing a variety of
products from various categories based on your browsing history and selects

Dipesh Shrestha 18030022 8


CU6051NI Artificial Intelligence

those ones that you are most likely to purchase. Recommendation engines began
their journey in e-commerce, but they are now gaining traction in a variety of other
fields, including the media. [ CITATION Rod19 \l 1033 ]

Solution

Explanation of proposed solution.

The evolution of the Movie Recommendation System was investigated. The


primary objective of this study is to determine how the suggestion system makes
work easier and more enjoyable. For this project, I looked into AI and machine
learning for a collaborative filtering algorithm recommendation system. A study
was conducted to overcome the challenges experienced by users to address the
problem that we stated in the problem domain section above. I will utilize the
Python programming language and collaborative filtering to create this system.

Dipesh Shrestha 18030022 9


CU6051NI Artificial Intelligence

Explanation of algorithm used:

Collaborative filtering refers to a set of algorithms that include various methods for
locating comparable people or objects, as well as numerous methods for
calculating ratings based on the ratings of similar users. You may end up with a
collaborative filtering method depending on your choices. You will learn about the
various methods for determining similarity and predicting ratings. [ CITATION
Abh12 \l 1033 ]

Figure 3 Collaborating filter

There are 2 types of collaborative filtering algorithms:

User-based Collaborative filtering

The main concept is to locate users who have similar previous preference
patterns as user "A" and then recommend to him or her things that those similar
users have enjoyed but that "A" has not yet experienced. This is accomplished

Dipesh Shrestha 18030022 10


CU6051NI Artificial Intelligence

by creating a matrix of items that each user has rated/viewed/liked/clicked


depending on the task at hand, computing the similarity score between the
users, and then recommending items that the concerned user is unaware of but
that users similar to him/her are aware of and liked. [ CITATION SO_20 \l 1033 ]

For example, if user 'A' like 'Batman Begins,' 'Justice League,' and 'The
Avengers,' and user 'B' enjoys 'Batman Begins,' 'Justice League,' and 'Thor,' they
have comparable interests because these films are all super-hero films. As a
result, there's a good chance that user 'A' will enjoy 'Thor,' whereas user 'B' will
enjoy 'The Avengers.' [ CITATION SO_20 \l 1033 ]

Figure 4 User based collaborative filtering

Dipesh Shrestha 18030022 11


CU6051NI Artificial Intelligence

Item-based Collaborative Filtering

In this concept, the idea is to discover comparable movies rather than similar
users, and then propose similar movies to ‘A' based on his or her previous
choices. This is accomplished by locating every pair of things that were
rated/viewed/liked/clicked by the same user, calculating the similarity of those
rated/viewed/liked/clicked across all users who rated/viewed/liked/clicked both,
and then suggesting them based on the similarity scores. [ CITATION SO_20 \l
1033 ]

Here, for example, we take 2 movies ‘A’ and ‘B’ and check their ratings by all
users who have rated both the movies and based on the similarity of these
ratings and based on this rating similarity by users who have rated both we find
similar movies. So, if most common users have rated ‘A’ and ‘B’ both similarly
and it is highly probable that ‘A’ and ‘B’ are similar, therefore if someone has
watched and liked ‘A’ they should be recommended ‘B’ and vice versa.
[ CITATION SO_20 \l 1033 ]

Dipesh Shrestha 18030022 12


CU6051NI Artificial Intelligence

Figure 5 Item based collaborative filtering

Pseudocode of the solution

IMPORT Libraries

READ Dataset

SPLIT Dataset to train and test data

Dipesh Shrestha 18030022 13


CU6051NI Artificial Intelligence

CREATE model using Collaborative filtering algorithm


CALCULATE similarity score using Euclidean distance p
= (p1, ... , pd) ; q = (q1, ... , qd) sim(a,b)=1/1+d(a,b)
TRAIN model using train data

TEST model using test data

PREDICT using test dataset

RESULT output

Diagrammatical Representation

Dipesh Shrestha 18030022 14


CU6051NI Artificial Intelligence

Flow chart
Figure 6 Flow Chart

State transition Diagram

Dipesh Shrestha 18030022 15

Figure 7 state transition diagram


CU6051NI Artificial Intelligence

Explanation of the development process

The whole system I built for this project is developed by using python programming
language. With the use of Anaconda, I completed a recommendation engine that is
used for movie recommendations. Anaconda is a Python and R programming language
for data science, machine learning, and other applications that makes package
management and deployment easier. Anaconda is a free software that runs on
Windows, Mac OS X, and Linux. The Jupyter Notebook IDE is used to write all of the
code for the recommendation engine. Anaconda prompt is used to install the libraries
required for the projects. The implicit library, which is closely related to ALS, was utilized
to create this project.

Kaggle was used to receive all the user data set that is bound to be used in this project.
The raw data received were converted into usable data. The project is based on the
principle of if the user likes movies, he may like the movies which are same as the
movies s/he watched. The data contains the movie history of the user along with the
ratings s/he has given.

To begin, a Python script was used to create a MovieRecommender class. The focus of
the class then shifts to making suggestions from the implicit library. All of the user's data
has been trained, data and models have been imported, and all of the user's data sets
have been used to generate the suggestion. The data is then assigned to the ALS
model, which generates a suggestion for the user. Finally, it is saved as a csv file, which
I have included in the table.

Dipesh Shrestha 18030022 16


CU6051NI Artificial Intelligence

Achieved Results

The extracted data from Kaggle was retrieved in its raw form. We established a
separate file where we utilized the raw data and updated the document based on the
outcomes we needed for cleaning the raw data. Simple user data sets were produced
once the raw data file was converted to an appropriate file format and trained. Then,
five users' data are updated once the ALS algorithm is implemented. The movies that
are top rated from different users are reviewed and chosen for accurate
recommendation. The engine was able to propose up to 20 movies to the user with the
installation of the ALS algorithm. Different movies are recommended to the user at
different times. The data is also saved as a csv document in a separate file.

Dipesh Shrestha 18030022 17


CU6051NI Artificial Intelligence

Figure 8

Figure 9

Dipesh Shrestha 18030022 18


CU6051NI Artificial Intelligence

Figure 10

Figure 11

Dipesh Shrestha 18030022 19


CU6051NI Artificial Intelligence

Figure 12

Figure 13

Dipesh Shrestha 18030022 20


CU6051NI Artificial Intelligence

Figure 14

Figure 15

Figure 16

Dipesh Shrestha 18030022 21


CU6051NI Artificial Intelligence

Figure 17

Dipesh Shrestha 18030022 22


CU6051NI Artificial Intelligence

Conclusion
Analysis of the work

The whole table introduced below shows the analysis of the work in this project.
This coursework includes all the research and the works I have done to complete
a recommendation system and collaborative filtering system on the topic of AI.

S.no
Topic Status
.
1. Research on AI Topic Completed
2. Choose and confirm AI Topic Completed
3. Research on Recommendation System Completed
4. Research on problem domain and solution Completed
5. Research on Collaborative Filtering Method Completed
6. Choose and confirm AI Algorithm Completed
7. Research on similar Projects Completed
8. Pseudocode and Flowchart Completed
9. Finalize research document Completed
10. Start of the project Completed
11. Train Data Sets Completed
12. Implementing ALS Completed
13. Project Outcome Completed
14. Finalization of the project Completed
15. Finalization of the documentation Completed

Address to real world problem

There are several movie recommendation systems available, but they all lack
certain features. They are yet to be improvised and get better recommendations
with better selections. They still recommend movies based on their ratings, but the
user's choices should be considered as well.

Dipesh Shrestha 18030022 23


CU6051NI Artificial Intelligence

Further work

Following the completion of this class, we studied and learned about AI and
recommendation engines. We also learned about the recommendation system
and how the ALS algorithm works. We may be engaged on doing certain works
given below in future:

 Make a program based on content based to gain further knowledge on the


recommendation system.
 Make a program more reliable and faster.
 Try creating a hybrid model.

References
Ajitsaria, A. (2012). Real Python. Retrieved from Real Python:
https://realpython.com/build-recommendation-engine-collaborative-filtering/
Gosalia, V. (2018). International Research Journal of Engineering and Technology.
Movie Recommendation System, 301.
Nelson, S. (2019). Spotify’s Collaborative Filtering. Spotify’s Collaborative Filtering, 07.
Postmus, S. (2018). Recommender system techniques applied to Netflix movie.
Research Paper Business Analytics, 21.

Dipesh Shrestha 18030022 24


CU6051NI Artificial Intelligence

Schiavini, R. (2019). Smart Hint. Retrieved from Smart Hint:


https://www.smarthint.co/en/ai-product-recommendation-engine/?
fbclid=IwAR090923pc4Fi6a-Dj44OX7ispFl-DAWvlijTUDAn2j5sRyoWO5w-DiIfao
Selvamanikkam, M. (2018, 08 25). Being Human. Retrieved from Being Human:
https://becominghuman.ai/introduction-to-artificial-intelligence-5fba0148ec99
SO_HAM. (2020, November 9). Analytics Vidhya. Retrieved from Analytics Vidhya:
https://www.analyticsvidhya.com/blog/2020/11/create-your-own-movie-movie-
recommendation-system/

Dipesh Shrestha 18030022 25

You might also like