Skip to main content

Machine learning movie recommender

Project description

<h1 align="center">
Moviebox
<a href="https://github.com/klauscfhq/moviebox">
<img src="media/header.png" alt="Moviebox" width="90%">
</a>
</h1>

<h4 align="center">
🎥 Machine learning movie recommender
</h4>

[![Build Status](https://travis-ci.org/klauscfhq/moviebox.svg?branch=master)](https://travis-ci.org/klauscfhq/moviebox)

## Contents

- [Description](#description)
- [CLI](#cli)
- [Usage](#usage)
- [API](#api)
- [Development](#development)
- [Team](#team)
- [License](#license)

## Description

Moviebox is a content based machine learning recommending system build with the powers of [`tf-idf`](https://en.wikipedia.org/wiki/Tf%E2%80%93idf) and [`cosine similarities`](https://en.wikipedia.org/wiki/Cosine_similarity).

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.

The [dataset](moviebox/dataset/movies.csv) in use is a random subset of the [Carnegie Mellon Movie Summary Corpus](http://www.cs.cmu.edu/~ark/movie$-data/), and it consists of `5000` movie titles along with their respective categories and plots.

The nature of the project is heavily educational.

## Install

**`Python 3+`** is required to install or build the code. Support for **`Python 2+`** will be added soon.

```
pip3 install moviebox
```

## CLI

```
$ moviebox --help

🎥 Machine learning movie recommender

Usage
$ moviebox [<options> ...]

Options
--help, -h Display help message
--search, -s Search movie by ID
--movie, -m Input movie ID
--plot, -p Display movie plot
--interactive, -i Display process info
--recommendations, -r Number of movie recommendations
--version, -v Display installed version

Examples
$ moviebox --help
$ moviebox --search
$ moviebox --movie 2874
$ moviebox -m 2874 --recommendations 3
$ moviebox -m 2874 -r 3 --plot
$ moviebox -m 2874 -r 3 -p --interactive
```

## Usage

```python
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)
```

## API

#### recommender`(movieID, recommendationsNumber, showPlots, interactive)`

**E.g.** `recommender(movieID=2874, recommendationsNumber=3, showPlots=True, interactive=True)`

#### `movieID`

- Type: `Integer`

- Default Value: `2874`

- Optional: `True`

Input movie ID. Any natural number between `[0, 4999]` can be selected.

#### `recommendationsNumber`

- Type: `Integer`

- Default Value: `3`

- Optional: `True`

Number of movie recommendations to be generated. Any natural number between `[1, 30]` can be selected.

#### `showPlots`

- Type: `Boolean`

- Default Value: `False`

- Optional: `True`

Display the plot summary of each recommended movie.

#### `interactive`

- Type: `Boolean`

- Default Value: `False`

- Optional: `True`

Display process-related information while running.

## Development

- [Clone](https://help.github.com/articles/cloning-a-repository/) this repository to your local machine
- Navigate to your clone `cd moviebox`
- Install the dependencies `fab i`/`pip3 install -r requirements.txt`
- Check for errors `fab test`
- Run the API `fab start`
- Build the package `fab dist`
- Cleanup compiled files `fab clean`

## Team

- Mario Sinani ([@mariocfhq](https://github.com/mariocfhq))
- Klaus Sinani ([@klauscfhq](https://github.com/klauscfhq))

## License

[MIT](https://github.com/klauscfhq/moviebox/blob/master/license.md)


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moviebox-0.1.0.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moviebox-0.1.0-py3-none-any.whl (3.6 MB view details)

Uploaded Python 3

File details

Details for the file moviebox-0.1.0.tar.gz.

File metadata

  • Download URL: moviebox-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for moviebox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ad81b00f4c6e31de8436e50b6fba217ccca9969addc3abc1f84969e165eadfa
MD5 4f6cb60680bb5e71c5ccfc31a9b0e317
BLAKE2b-256 def6f77c65560ab5a13f256c2b70c669f795d4ed3bc0dda6a0ca30d2ff637867

See more details on using hashes here.

File details

Details for the file moviebox-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for moviebox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5e6e84d7aa731b32b3e3e66b58d6253d4b1a9534ac4718373da27b3a614e6e7
MD5 dbd0032fc7e47e3042cd8b8e6bc9c488
BLAKE2b-256 4b34b24244ec28162ef2ec0c3141f45a353da684c2f555087f294287639357f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page