Assignment - 3 NLP Abhiraj Singh

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

Assignment 3

NLP and Web Scrapping

Name – Abhiraj Singh Uid – 22BCS12473

1. What is collaborative filtering? Implement in python code and also


explain the library.

Solution –

Collaborative filtering is a technique used in recommendation systems to make predictions


about the interests of a user by collecting preferences from many users (collaborating). It
works based on the assumption that if a user A has similar preferences to a user B on certain
items, then A is likely to have similar preferences to B on other items as well.

There are two main types of collaborative filtering:

1. User-based collaborative filtering: This approach recommends items by finding


similar users to the target user and recommending items that those similar users have
liked or interacted with.
2. Item-based collaborative filtering: This approach recommends items by finding
similar items to those that the target user has liked or interacted with in the past.

Code Implementation –
2. Explain Content Based filtering? Implement in python code.

Solution –

Content-based filtering is a recommendation system technique that recommends items to


users based on the attributes or features of the items themselves. It works by analyzing the
features of items that a user has liked, interacted with, or rated highly in the past, and then
recommending similar items with similar features.

Here's a step-by-step explanation of content-based filtering:

1. Feature Extraction: Extract relevant features or attributes from the items in the
dataset. These features can include metadata such as genre, actors, director, keywords,
etc., for movies; author, title, text content, etc., for articles or books; or any other
relevant attributes for different types of items.
2. Profile Creation: Create a user profile based on the features of items that the user has
liked, interacted with, or rated highly in the past. This profile represents the user's
preferences for different features or attributes.
3. Similarity Calculation: Calculate the similarity between the user profile and each
item in the dataset based on their features. Various similarity measures can be used,
such as cosine similarity, Euclidean distance, or Pearson correlation coefficient.
4. Recommendation Generation: Rank the items in the dataset based on their similarity
to the user profile and recommend the top-ranked items to the user.

Code Implementation –

3. Make recommendation system for Market Analysis application in


python.
Solution –

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy