? a machine learning movie recommender for your CLI
source link: https://www.tuicool.com/articles/hit/Af2EnyN
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
:movie_camera: Machine learning movie recommender
Initially, a natural number, that corresponds to the ID of a unique movie title, is accepted as input from the user. Through
tf-idf the plot summaries of 5000 different movies that reside in the dataset, are analyzed and vectorized. Next, a number of movies is chosen as recommendations based on their
cosine similarity with the vectorized input movie. Specifically, the cosine value of the angle between any two non-zero vectors, resulting from their inner product, is used as the primary measure of similarity. Thus, only movies whose story and meaning are as close as possible to the initial one, are displayed to the user as recommendations.
pip install moviebox
Python 2.7+ or
Python 3.4+ is required to install or build the code.
$ moviebox --help :movie_camera: Machine learning movie recommender Usage $ moviebox [<options> ...] Options --help, -h Display help message --search, -s Search movie by ID --movie, -m <int> Input movie ID [Can be any integer 0-4999] --plot, -p Display movie plot --interactive, -i Display process info --list, -l List available movie titles --recommend, -r <int> Number of recommendations [Can be any integer 1-30] --version, -v Display installed version Examples $ moviebox --help $ moviebox --search $ moviebox --movie 2874 $ moviebox -m 2874 --recommend 3 $ moviebox -m 2874 -r 3 --plot $ moviebox -m 2874 -r 3 -p --interactive
from moviebox.recommender import recommender movieID = 2874 # Movie ID of `Asterix & Obelix: God save Britannia` recommendationsNumber = 3 # Get 3 movie recommendations showPlots = True # Display the plot of each recommended movie interactive = True # Display process info while running # Generate the recommendations recommender( movieID=movieID, recommendationsNumber=recommendationsNumber, showPlots=showPlots, interactive=interactive)
(movieID, recommendationsNumber, showPlots, interactive)
recommender(movieID=2874, recommendationsNumber=3, showPlots=True, interactive=True)
Input movie ID. Any integer between
[0, 4999] can be selected.
Number of movie recommendations to be generated. Any integer between
[1, 30] can be selected.
Display the plot summary of each recommended movie.
Display process-related information while running.
- Clone this repository to your local machine
- Navigate to your clone
- Install the dependencies
pip install -r requirements.txt
- Check for errors
- Run the API
- Build the package
- Cleanup compiled files
Coded with ❤ by
Aggregate valuable and interesting links.
Joyk means Joy of geeK