Coder Social home page Coder Social logo

kamaravichow / movie-recommendation-python Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 9.57 MB

Machine learning powered model to recommend movies based on your interests written in python.

License: Apache License 2.0

Python 100.00%
machine-learning recommend-movies python cosine-similarity dataset

movie-recommendation-python's Introduction

movie-recommendation-engine

Machine learning powered model to recommend movies based on your interests written in python.

Libraries :

  • sklearn.feature_extraction.text.CountVectorizer :

Convert a collection of text documents to a matrix of token counts

  • sklearn.metrics.pairwise.cosine_similarity(X, Y=None, dense_output=True) :

Compute cosine similarity between samples in X and Y. Cosine similarity, or the cosine kernel, computes similarity as the normalized dot product of X and Y:

Notes :

def combine_features(row):
	try:
	  return row['keywords']+ " "+row['cast']+" "+row['genres']+" "+row['director']
	except:
		print("Error", row)

This method is used because the kewords in the dataset has a "NaN" in it. We need to replace it with an empty string (You can do whatever you want). We make a for loop for that.

for feature in features:
	df[feature] = df[feature].fillna('') 

Simple system to break the loop after we get 50 suggestions

i=0
for movie in sorted_similar_movies:
	print(get_title_from_index(movie[0]))
	i=i+1
	if i>50:
		break

Usage : Unzip the dataset zip file and then use it.

movie-recommendation-python's People

Contributors

deepsourcebot avatar kamaravichow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

krishnamurtyp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.