{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Movie Recommendor Sysytem" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", "import ast\n", "import nltk" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "movies=pd.read_csv(\"C://Users//ARYA SHARMA//Downloads//archive//tmdb_5000_movies.csv\")\n", "credits=pd.read_csv(\"C://Users//ARYA SHARMA//Downloads//archive//tmdb_5000_credits.csv\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | budget | \n", "genres | \n", "homepage | \n", "id | \n", "keywords | \n", "original_language | \n", "original_title | \n", "overview | \n", "popularity | \n", "production_companies | \n", "production_countries | \n", "release_date | \n", "revenue | \n", "runtime | \n", "spoken_languages | \n", "status | \n", "tagline | \n", "title | \n", "vote_average | \n", "vote_count | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "237000000 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "http://www.avatarmovie.com/ | \n", "19995 | \n", "[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... | \n", "en | \n", "Avatar | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "150.437577 | \n", "[{\"name\": \"Ingenious Film Partners\", \"id\": 289... | \n", "[{\"iso_3166_1\": \"US\", \"name\": \"United States o... | \n", "2009-12-10 | \n", "2787965087 | \n", "162.0 | \n", "[{\"iso_639_1\": \"en\", \"name\": \"English\"}, {\"iso... | \n", "Released | \n", "Enter the World of Pandora. | \n", "Avatar | \n", "7.2 | \n", "11800 | \n", "
1 | \n", "300000000 | \n", "[{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"... | \n", "http://disney.go.com/disneypictures/pirates/ | \n", "285 | \n", "[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... | \n", "en | \n", "Pirates of the Caribbean: At World's End | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "139.082615 | \n", "[{\"name\": \"Walt Disney Pictures\", \"id\": 2}, {\"... | \n", "[{\"iso_3166_1\": \"US\", \"name\": \"United States o... | \n", "2007-05-19 | \n", "961000000 | \n", "169.0 | \n", "[{\"iso_639_1\": \"en\", \"name\": \"English\"}] | \n", "Released | \n", "At the end of the world, the adventure begins. | \n", "Pirates of the Caribbean: At World's End | \n", "6.9 | \n", "4500 | \n", "
2 | \n", "245000000 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "http://www.sonypictures.com/movies/spectre/ | \n", "206647 | \n", "[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... | \n", "en | \n", "Spectre | \n", "A cryptic message from Bond’s past sends him o... | \n", "107.376788 | \n", "[{\"name\": \"Columbia Pictures\", \"id\": 5}, {\"nam... | \n", "[{\"iso_3166_1\": \"GB\", \"name\": \"United Kingdom\"... | \n", "2015-10-26 | \n", "880674609 | \n", "148.0 | \n", "[{\"iso_639_1\": \"fr\", \"name\": \"Fran\\u00e7ais\"},... | \n", "Released | \n", "A Plan No One Escapes | \n", "Spectre | \n", "6.3 | \n", "4466 | \n", "
3 | \n", "250000000 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam... | \n", "http://www.thedarkknightrises.com/ | \n", "49026 | \n", "[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... | \n", "en | \n", "The Dark Knight Rises | \n", "Following the death of District Attorney Harve... | \n", "112.312950 | \n", "[{\"name\": \"Legendary Pictures\", \"id\": 923}, {\"... | \n", "[{\"iso_3166_1\": \"US\", \"name\": \"United States o... | \n", "2012-07-16 | \n", "1084939099 | \n", "165.0 | \n", "[{\"iso_639_1\": \"en\", \"name\": \"English\"}] | \n", "Released | \n", "The Legend Ends | \n", "The Dark Knight Rises | \n", "7.6 | \n", "9106 | \n", "
4 | \n", "260000000 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "http://movies.disney.com/john-carter | \n", "49529 | \n", "[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... | \n", "en | \n", "John Carter | \n", "John Carter is a war-weary, former military ca... | \n", "43.926995 | \n", "[{\"name\": \"Walt Disney Pictures\", \"id\": 2}] | \n", "[{\"iso_3166_1\": \"US\", \"name\": \"United States o... | \n", "2012-03-07 | \n", "284139100 | \n", "132.0 | \n", "[{\"iso_639_1\": \"en\", \"name\": \"English\"}] | \n", "Released | \n", "Lost in our world, found in another. | \n", "John Carter | \n", "6.1 | \n", "2124 | \n", "
\n", " | genres | \n", "keywords | \n", "overview | \n", "title | \n", "movie_id | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "Avatar | \n", "19995 | \n", "[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... | \n", "[{\"credit_id\": \"52fe48009251416c750aca23\", \"de... | \n", "
1 | \n", "[{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"... | \n", "[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "Pirates of the Caribbean: At World's End | \n", "285 | \n", "[{\"cast_id\": 4, \"character\": \"Captain Jack Spa... | \n", "[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... | \n", "
2 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... | \n", "A cryptic message from Bond’s past sends him o... | \n", "Spectre | \n", "206647 | \n", "[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... | \n", "[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... | \n", "
3 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam... | \n", "[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... | \n", "Following the death of District Attorney Harve... | \n", "The Dark Knight Rises | \n", "49026 | \n", "[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... | \n", "[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... | \n", "
4 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... | \n", "John Carter is a war-weary, former military ca... | \n", "John Carter | \n", "49529 | \n", "[{\"cast_id\": 5, \"character\": \"John Carter\", \"c... | \n", "[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... | \n", "
\n", " | genres | \n", "keywords | \n", "overview | \n", "title | \n", "movie_id | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "Avatar | \n", "19995 | \n", "[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... | \n", "[{\"credit_id\": \"52fe48009251416c750aca23\", \"de... | \n", "
1 | \n", "[Adventure, Fantasy, Action] | \n", "[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "Pirates of the Caribbean: At World's End | \n", "285 | \n", "[{\"cast_id\": 4, \"character\": \"Captain Jack Spa... | \n", "[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... | \n", "
2 | \n", "[Action, Adventure, Crime] | \n", "[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... | \n", "A cryptic message from Bond’s past sends him o... | \n", "Spectre | \n", "206647 | \n", "[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... | \n", "[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... | \n", "
3 | \n", "[Action, Crime, Drama, Thriller] | \n", "[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... | \n", "Following the death of District Attorney Harve... | \n", "The Dark Knight Rises | \n", "49026 | \n", "[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... | \n", "[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... | \n", "
4 | \n", "[Action, Adventure, Science Fiction] | \n", "[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... | \n", "John Carter is a war-weary, former military ca... | \n", "John Carter | \n", "49529 | \n", "[{\"cast_id\": 5, \"character\": \"John Carter\", \"c... | \n", "[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... | \n", "
\n", " | genres | \n", "keywords | \n", "overview | \n", "title | \n", "movie_id | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[culture clash, future, space war, space colon... | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "Avatar | \n", "19995 | \n", "[Sam Worthington, Zoe Saldana, Sigourney Weaver] | \n", "[{\"credit_id\": \"52fe48009251416c750aca23\", \"de... | \n", "
1 | \n", "[Adventure, Fantasy, Action] | \n", "[ocean, drug abuse, exotic island, east india ... | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "Pirates of the Caribbean: At World's End | \n", "285 | \n", "[Johnny Depp, Orlando Bloom, Keira Knightley] | \n", "[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... | \n", "
2 | \n", "[Action, Adventure, Crime] | \n", "[spy, based on novel, secret agent, sequel, mi... | \n", "A cryptic message from Bond’s past sends him o... | \n", "Spectre | \n", "206647 | \n", "[Daniel Craig, Christoph Waltz, Léa Seydoux] | \n", "[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... | \n", "
3 | \n", "[Action, Crime, Drama, Thriller] | \n", "[dc comics, crime fighter, terrorist, secret i... | \n", "Following the death of District Attorney Harve... | \n", "The Dark Knight Rises | \n", "49026 | \n", "[Christian Bale, Michael Caine, Gary Oldman] | \n", "[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... | \n", "
4 | \n", "[Action, Adventure, Science Fiction] | \n", "[based on novel, mars, medallion, space travel... | \n", "John Carter is a war-weary, former military ca... | \n", "John Carter | \n", "49529 | \n", "[Taylor Kitsch, Lynn Collins, Samantha Morton] | \n", "[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... | \n", "
\n", " | genres | \n", "keywords | \n", "overview | \n", "title | \n", "movie_id | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[culture clash, future, space war, space colon... | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "Avatar | \n", "19995 | \n", "[Sam Worthington, Zoe Saldana, Sigourney Weaver] | \n", "[James Cameron] | \n", "
1 | \n", "[Adventure, Fantasy, Action] | \n", "[ocean, drug abuse, exotic island, east india ... | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "Pirates of the Caribbean: At World's End | \n", "285 | \n", "[Johnny Depp, Orlando Bloom, Keira Knightley] | \n", "[Gore Verbinski] | \n", "
2 | \n", "[Action, Adventure, Crime] | \n", "[spy, based on novel, secret agent, sequel, mi... | \n", "A cryptic message from Bond’s past sends him o... | \n", "Spectre | \n", "206647 | \n", "[Daniel Craig, Christoph Waltz, Léa Seydoux] | \n", "[Sam Mendes] | \n", "
3 | \n", "[Action, Crime, Drama, Thriller] | \n", "[dc comics, crime fighter, terrorist, secret i... | \n", "Following the death of District Attorney Harve... | \n", "The Dark Knight Rises | \n", "49026 | \n", "[Christian Bale, Michael Caine, Gary Oldman] | \n", "[Christopher Nolan] | \n", "
4 | \n", "[Action, Adventure, Science Fiction] | \n", "[based on novel, mars, medallion, space travel... | \n", "John Carter is a war-weary, former military ca... | \n", "John Carter | \n", "49529 | \n", "[Taylor Kitsch, Lynn Collins, Samantha Morton] | \n", "[Andrew Stanton] | \n", "
\n", " | genres | \n", "keywords | \n", "overview | \n", "title | \n", "movie_id | \n", "cast | \n", "crew | \n", "genre | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[cultureclash, future, spacewar, spacecolony, ... | \n", "[In, the, 22nd, century,, a, paraplegic, Marin... | \n", "Avatar | \n", "19995 | \n", "[SamWorthington, ZoeSaldana, SigourneyWeaver] | \n", "[JamesCameron] | \n", "[Action, Adventure, Fantasy, ScienceFiction] | \n", "
1 | \n", "[Adventure, Fantasy, Action] | \n", "[ocean, drugabuse, exoticisland, eastindiatrad... | \n", "[Captain, Barbossa,, long, believed, to, be, d... | \n", "Pirates of the Caribbean: At World's End | \n", "285 | \n", "[JohnnyDepp, OrlandoBloom, KeiraKnightley] | \n", "[GoreVerbinski] | \n", "[Adventure, Fantasy, Action] | \n", "
2 | \n", "[Action, Adventure, Crime] | \n", "[spy, basedonnovel, secretagent, sequel, mi6, ... | \n", "[A, cryptic, message, from, Bond’s, past, send... | \n", "Spectre | \n", "206647 | \n", "[DanielCraig, ChristophWaltz, LéaSeydoux] | \n", "[SamMendes] | \n", "[Action, Adventure, Crime] | \n", "
3 | \n", "[Action, Crime, Drama, Thriller] | \n", "[dccomics, crimefighter, terrorist, secretiden... | \n", "[Following, the, death, of, District, Attorney... | \n", "The Dark Knight Rises | \n", "49026 | \n", "[ChristianBale, MichaelCaine, GaryOldman] | \n", "[ChristopherNolan] | \n", "[Action, Crime, Drama, Thriller] | \n", "
4 | \n", "[Action, Adventure, Science Fiction] | \n", "[basedonnovel, mars, medallion, spacetravel, p... | \n", "[John, Carter, is, a, war-weary,, former, mili... | \n", "John Carter | \n", "49529 | \n", "[TaylorKitsch, LynnCollins, SamanthaMorton] | \n", "[AndrewStanton] | \n", "[Action, Adventure, ScienceFiction] | \n", "
\n", " | genres | \n", "keywords | \n", "overview | \n", "title | \n", "movie_id | \n", "cast | \n", "crew | \n", "genre | \n", "tags | \n", "
---|---|---|---|---|---|---|---|---|---|
0 | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[cultureclash, future, spacewar, spacecolony, ... | \n", "[In, the, 22nd, century,, a, paraplegic, Marin... | \n", "Avatar | \n", "19995 | \n", "[SamWorthington, ZoeSaldana, SigourneyWeaver] | \n", "[JamesCameron] | \n", "[Action, Adventure, Fantasy, ScienceFiction] | \n", "[In, the, 22nd, century,, a, paraplegic, Marin... | \n", "
1 | \n", "[Adventure, Fantasy, Action] | \n", "[ocean, drugabuse, exoticisland, eastindiatrad... | \n", "[Captain, Barbossa,, long, believed, to, be, d... | \n", "Pirates of the Caribbean: At World's End | \n", "285 | \n", "[JohnnyDepp, OrlandoBloom, KeiraKnightley] | \n", "[GoreVerbinski] | \n", "[Adventure, Fantasy, Action] | \n", "[Captain, Barbossa,, long, believed, to, be, d... | \n", "
2 | \n", "[Action, Adventure, Crime] | \n", "[spy, basedonnovel, secretagent, sequel, mi6, ... | \n", "[A, cryptic, message, from, Bond’s, past, send... | \n", "Spectre | \n", "206647 | \n", "[DanielCraig, ChristophWaltz, LéaSeydoux] | \n", "[SamMendes] | \n", "[Action, Adventure, Crime] | \n", "[A, cryptic, message, from, Bond’s, past, send... | \n", "
3 | \n", "[Action, Crime, Drama, Thriller] | \n", "[dccomics, crimefighter, terrorist, secretiden... | \n", "[Following, the, death, of, District, Attorney... | \n", "The Dark Knight Rises | \n", "49026 | \n", "[ChristianBale, MichaelCaine, GaryOldman] | \n", "[ChristopherNolan] | \n", "[Action, Crime, Drama, Thriller] | \n", "[Following, the, death, of, District, Attorney... | \n", "
4 | \n", "[Action, Adventure, Science Fiction] | \n", "[basedonnovel, mars, medallion, spacetravel, p... | \n", "[John, Carter, is, a, war-weary,, former, mili... | \n", "John Carter | \n", "49529 | \n", "[TaylorKitsch, LynnCollins, SamanthaMorton] | \n", "[AndrewStanton] | \n", "[Action, Adventure, ScienceFiction] | \n", "[John, Carter, is, a, war-weary,, former, mili... | \n", "
\n", " | movie_id | \n", "title | \n", "tags | \n", "
---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "[In, the, 22nd, century,, a, paraplegic, Marin... | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "[Captain, Barbossa,, long, believed, to, be, d... | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "[A, cryptic, message, from, Bond’s, past, send... | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "[Following, the, death, of, District, Attorney... | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "[John, Carter, is, a, war-weary,, former, mili... | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "
4804 | \n", "9367 | \n", "El Mariachi | \n", "[El, Mariachi, just, wants, to, play, his, gui... | \n", "
4805 | \n", "72766 | \n", "Newlyweds | \n", "[A, newlywed, couple's, honeymoon, is, upended... | \n", "
4806 | \n", "231617 | \n", "Signed, Sealed, Delivered | \n", "[\"Signed,, Sealed,, Delivered\", introduces, a,... | \n", "
4807 | \n", "126186 | \n", "Shanghai Calling | \n", "[When, ambitious, New, York, attorney, Sam, is... | \n", "
4808 | \n", "25975 | \n", "My Date with Drew | \n", "[Ever, since, the, second, grade, when, he, fi... | \n", "
4806 rows × 3 columns
\n", "\n", " | movie_id | \n", "title | \n", "tags | \n", "
---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "A cryptic message from Bond’s past sends him o... | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "Following the death of District Attorney Harve... | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "John Carter is a war-weary, former military ca... | \n", "
\n", " | movie_id | \n", "title | \n", "tags | \n", "
---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "in the 22nd century, a paraplegic marine is di... | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "captain barbossa, long believed to be dead, ha... | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "a cryptic message from bond’s past sends him o... | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "following the death of district attorney harve... | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "john carter is a war-weary, former military ca... | \n", "
\n", " | movie_id | \n", "title | \n", "tags | \n", "
---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "in the 22nd century, a parapleg marin is dispa... | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "captain barbossa, long believ to be dead, ha c... | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "a cryptic messag from bond’ past send him on a... | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "follow the death of district attorney harvey d... | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "john carter is a war-weary, former militari ca... | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "
4804 | \n", "9367 | \n", "El Mariachi | \n", "el mariachi just want to play hi guitar and ca... | \n", "
4805 | \n", "72766 | \n", "Newlyweds | \n", "a newlyw couple' honeymoon is upend by the arr... | \n", "
4806 | \n", "231617 | \n", "Signed, Sealed, Delivered | \n", "\"signed, sealed, delivered\" introduc a dedic q... | \n", "
4807 | \n", "126186 | \n", "Shanghai Calling | \n", "when ambiti new york attorney sam is sent to s... | \n", "
4808 | \n", "25975 | \n", "My Date with Drew | \n", "ever sinc the second grade when he first saw h... | \n", "
4806 rows × 3 columns
\n", "