{"cells":[{"metadata":{},"cell_type":"markdown","source":"# 1. Introduction \n\nThe goal of this project is to develop a content-based recommendation engine for movies and TV shows on Netflix. I will compare two different methods:\n\n1. Using *cast, director, country, rating and genres* as features.\n2. Using the words in the movie/TV show *descriptions* as features."},{"metadata":{},"cell_type":"markdown","source":"# 2. Imports"},{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport re\n\nimport nltk\nfrom nltk.corpus import stopwords\nnltk.download('stopwords')\nfrom nltk.tokenize import word_tokenize","execution_count":2,"outputs":[{"output_type":"stream","text":"[nltk_data] Downloading package stopwords to /usr/share/nltk_data...\n[nltk_data] Package stopwords is already up-to-date!\n","name":"stdout"}]},{"metadata":{},"cell_type":"markdown","source":"# 3. Loading data"},{"metadata":{"trusted":true},"cell_type":"code","source":"data = pd.read_csv('../input/netflix-shows/netflix_titles.csv')\ndata.head()","execution_count":3,"outputs":[{"output_type":"execute_result","execution_count":3,"data":{"text/plain":" show_id type title director \\\n0 s1 TV Show 3% NaN \n1 s2 Movie 7:19 Jorge Michel Grau \n2 s3 Movie 23:59 Gilbert Chan \n3 s4 Movie 9 Shane Acker \n4 s5 Movie 21 Robert Luketic \n\n cast country \\\n0 João Miguel, Bianca Comparato, Michel Gomes, R... Brazil \n1 Demián Bichir, Héctor Bonilla, Oscar Serrano, ... Mexico \n2 Tedd Chan, Stella Chung, Henley Hii, Lawrence ... Singapore \n3 Elijah Wood, John C. Reilly, Jennifer Connelly... United States \n4 Jim Sturgess, Kevin Spacey, Kate Bosworth, Aar... United States \n\n date_added release_year rating duration \\\n0 August 14, 2020 2020 TV-MA 4 Seasons \n1 December 23, 2016 2016 TV-MA 93 min \n2 December 20, 2018 2011 R 78 min \n3 November 16, 2017 2009 PG-13 80 min \n4 January 1, 2020 2008 PG-13 123 min \n\n listed_in \\\n0 International TV Shows, TV Dramas, TV Sci-Fi &... \n1 Dramas, International Movies \n2 Horror Movies, International Movies \n3 Action & Adventure, Independent Movies, Sci-Fi... \n4 Dramas \n\n description \n0 In a future where the elite inhabit an island ... \n1 After a devastating earthquake hits Mexico Cit... \n2 When an army recruit is found dead, his fellow... \n3 In a postapocalyptic world, rag-doll robots hi... \n4 A brilliant group of students become card-coun... ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
show_idtypetitledirectorcastcountrydate_addedrelease_yearratingdurationlisted_indescription
0s1TV Show3%NaNJoão Miguel, Bianca Comparato, Michel Gomes, R...BrazilAugust 14, 20202020TV-MA4 SeasonsInternational TV Shows, TV Dramas, TV Sci-Fi &...In a future where the elite inhabit an island ...
1s2Movie7:19Jorge Michel GrauDemián Bichir, Héctor Bonilla, Oscar Serrano, ...MexicoDecember 23, 20162016TV-MA93 minDramas, International MoviesAfter a devastating earthquake hits Mexico Cit...
2s3Movie23:59Gilbert ChanTedd Chan, Stella Chung, Henley Hii, Lawrence ...SingaporeDecember 20, 20182011R78 minHorror Movies, International MoviesWhen an army recruit is found dead, his fellow...
3s4Movie9Shane AckerElijah Wood, John C. Reilly, Jennifer Connelly...United StatesNovember 16, 20172009PG-1380 minAction & Adventure, Independent Movies, Sci-Fi...In a postapocalyptic world, rag-doll robots hi...
4s5Movie21Robert LuketicJim Sturgess, Kevin Spacey, Kate Bosworth, Aar...United StatesJanuary 1, 20202008PG-13123 minDramasA brilliant group of students become card-coun...
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"data.groupby('type').count()","execution_count":4,"outputs":[{"output_type":"execute_result","execution_count":4,"data":{"text/plain":" show_id title director cast country date_added release_year \\\ntype \nMovie 5377 5377 5214 4951 5147 5377 5377 \nTV Show 2410 2410 184 2118 2133 2400 2410 \n\n rating duration listed_in description \ntype \nMovie 5372 5377 5377 5377 \nTV Show 2408 2410 2410 2410 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
show_idtitledirectorcastcountrydate_addedrelease_yearratingdurationlisted_indescription
type
Movie53775377521449515147537753775372537753775377
TV Show2410241018421182133240024102408241024102410
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"data = data.dropna(subset=['cast', 'country', 'rating'])","execution_count":5,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# 4. Developing Recommendation Engine using *cast, director, country, rating and genres*"},{"metadata":{"trusted":true},"cell_type":"code","source":"movies = data[data['type'] == 'Movie'].reset_index()\nmovies = movies.drop(['index', 'show_id', 'type', 'date_added', 'release_year', 'duration', 'description'], axis=1)\nmovies.head()","execution_count":6,"outputs":[{"output_type":"execute_result","execution_count":6,"data":{"text/plain":" title director \\\n0 7:19 Jorge Michel Grau \n1 23:59 Gilbert Chan \n2 9 Shane Acker \n3 21 Robert Luketic \n4 122 Yasir Al Yasiri \n\n cast country rating \\\n0 Demián Bichir, Héctor Bonilla, Oscar Serrano, ... Mexico TV-MA \n1 Tedd Chan, Stella Chung, Henley Hii, Lawrence ... Singapore R \n2 Elijah Wood, John C. Reilly, Jennifer Connelly... United States PG-13 \n3 Jim Sturgess, Kevin Spacey, Kate Bosworth, Aar... United States PG-13 \n4 Amina Khalil, Ahmed Dawood, Tarek Lotfy, Ahmed... Egypt TV-MA \n\n listed_in \n0 Dramas, International Movies \n1 Horror Movies, International Movies \n2 Action & Adventure, Independent Movies, Sci-Fi... \n3 Dramas \n4 Horror Movies, International Movies ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_in
07:19Jorge Michel GrauDemián Bichir, Héctor Bonilla, Oscar Serrano, ...MexicoTV-MADramas, International Movies
123:59Gilbert ChanTedd Chan, Stella Chung, Henley Hii, Lawrence ...SingaporeRHorror Movies, International Movies
29Shane AckerElijah Wood, John C. Reilly, Jennifer Connelly...United StatesPG-13Action & Adventure, Independent Movies, Sci-Fi...
321Robert LuketicJim Sturgess, Kevin Spacey, Kate Bosworth, Aar...United StatesPG-13Dramas
4122Yasir Al YasiriAmina Khalil, Ahmed Dawood, Tarek Lotfy, Ahmed...EgyptTV-MAHorror Movies, International Movies
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"tv = data[data['type'] == 'TV Show'].reset_index()\ntv = tv.drop(['index', 'show_id', 'type', 'date_added', 'release_year', 'duration', 'description'], axis=1)\ntv.head()","execution_count":7,"outputs":[{"output_type":"execute_result","execution_count":7,"data":{"text/plain":" title director \\\n0 3% NaN \n1 46 Serdar Akar \n2 1983 NaN \n3 ​SAINT SEIYA: Knights of the Zodiac NaN \n4 #blackAF NaN \n\n cast country \\\n0 João Miguel, Bianca Comparato, Michel Gomes, R... Brazil \n1 Erdal Beşikçioğlu, Yasemin Allen, Melis Birkan... Turkey \n2 Robert Więckiewicz, Maciej Musiał, Michalina O... Poland, United States \n3 Bryson Baugus, Emily Neves, Blake Shepard, Pat... Japan \n4 Kenya Barris, Rashida Jones, Iman Benson, Genn... United States \n\n rating listed_in \n0 TV-MA International TV Shows, TV Dramas, TV Sci-Fi &... \n1 TV-MA International TV Shows, TV Dramas, TV Mysteries \n2 TV-MA Crime TV Shows, International TV Shows, TV Dramas \n3 TV-14 Anime Series, International TV Shows \n4 TV-MA TV Comedies ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_in
03%NaNJoão Miguel, Bianca Comparato, Michel Gomes, R...BrazilTV-MAInternational TV Shows, TV Dramas, TV Sci-Fi &...
146Serdar AkarErdal Beşikçioğlu, Yasemin Allen, Melis Birkan...TurkeyTV-MAInternational TV Shows, TV Dramas, TV Mysteries
21983NaNRobert Więckiewicz, Maciej Musiał, Michalina O...Poland, United StatesTV-MACrime TV Shows, International TV Shows, TV Dramas
3​SAINT SEIYA: Knights of the ZodiacNaNBryson Baugus, Emily Neves, Blake Shepard, Pat...JapanTV-14Anime Series, International TV Shows
4#blackAFNaNKenya Barris, Rashida Jones, Iman Benson, Genn...United StatesTV-MATV Comedies
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"actors = []\n\nfor i in movies['cast']:\n actor = re.split(r', \\s*', i)\n actors.append(actor)\n \nflat_list = []\nfor sublist in actors:\n for item in sublist:\n flat_list.append(item)\n \nactors_list = sorted(set(flat_list))\n\nbinary_actors = [[0] * 0 for i in range(len(set(flat_list)))]\n\nfor i in movies['cast']:\n k = 0\n for j in actors_list:\n if j in i:\n binary_actors[k].append(1.0)\n else:\n binary_actors[k].append(0.0)\n k+=1\n \nbinary_actors = pd.DataFrame(binary_actors).transpose()\n \ndirectors = []\n\nfor i in movies['director']:\n if pd.notna(i):\n director = re.split(r', \\s*', i)\n directors.append(director)\n \nflat_list2 = []\nfor sublist in directors:\n for item in sublist:\n flat_list2.append(item)\n \ndirectors_list = sorted(set(flat_list2))\n\nbinary_directors = [[0] * 0 for i in range(len(set(flat_list2)))]\n\nfor i in movies['director']:\n k = 0\n for j in directors_list:\n if pd.isna(i):\n binary_directors[k].append(0.0)\n elif j in i:\n binary_directors[k].append(1.0)\n else:\n binary_directors[k].append(0.0)\n k+=1\n \nbinary_directors = pd.DataFrame(binary_directors).transpose()\n \ncountries = []\n\nfor i in movies['country']:\n country = re.split(r', \\s*', i)\n countries.append(country)\n \nflat_list3 = []\nfor sublist in countries:\n for item in sublist:\n flat_list3.append(item)\n \ncountries_list = sorted(set(flat_list3))\n\nbinary_countries = [[0] * 0 for i in range(len(set(flat_list3)))]\n\nfor i in movies['country']:\n k = 0\n for j in countries_list:\n if j in i:\n binary_countries[k].append(1.0)\n else:\n binary_countries[k].append(0.0)\n k+=1\n \nbinary_countries = pd.DataFrame(binary_countries).transpose()\n\ngenres = []\n\nfor i in movies['listed_in']:\n genre = re.split(r', \\s*', i)\n genres.append(genre)\n \nflat_list4 = []\nfor sublist in genres:\n for item in sublist:\n flat_list4.append(item)\n \ngenres_list = sorted(set(flat_list4))\n\nbinary_genres = [[0] * 0 for i in range(len(set(flat_list4)))]\n\nfor i in movies['listed_in']:\n k = 0\n for j in genres_list:\n if j in i:\n binary_genres[k].append(1.0)\n else:\n binary_genres[k].append(0.0)\n k+=1\n \nbinary_genres = pd.DataFrame(binary_genres).transpose()\n\nratings = []\n\nfor i in movies['rating']:\n ratings.append(i)\n\nratings_list = sorted(set(ratings))\n\nbinary_ratings = [[0] * 0 for i in range(len(set(ratings_list)))]\n\nfor i in movies['rating']:\n k = 0\n for j in ratings_list:\n if j in i:\n binary_ratings[k].append(1.0)\n else:\n binary_ratings[k].append(0.0)\n k+=1\n \nbinary_ratings = pd.DataFrame(binary_ratings).transpose()","execution_count":33,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"binary = pd.concat([binary_actors, binary_directors, binary_countries, binary_genres], axis=1,ignore_index=True)\nbinary","execution_count":39,"outputs":[{"output_type":"execute_result","execution_count":39,"data":{"text/plain":" 0 1 2 3 4 5 6 7 8 9 \\\n0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n... ... ... ... ... ... ... ... ... ... ... \n4756 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n4757 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n4758 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n4759 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n4760 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n\n ... 26570 26571 26572 26573 26574 26575 26576 26577 26578 \\\n0 ... 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 \n1 ... 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 \n2 ... 1.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 \n3 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n4 ... 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 \n... ... ... ... ... ... ... ... ... ... ... \n4756 ... 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 \n4757 ... 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 \n4758 ... 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 \n4759 ... 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 \n4760 ... 0.0 1.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 \n\n 26579 \n0 0.0 \n1 0.0 \n2 0.0 \n3 0.0 \n4 0.0 \n... ... \n4756 0.0 \n4757 0.0 \n4758 0.0 \n4759 0.0 \n4760 0.0 \n\n[4761 rows x 26580 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
0123456789...26570265712657226573265742657526576265772657826579
00.00.00.00.00.00.00.00.00.00.0...0.01.00.01.00.00.00.00.00.00.0
10.00.00.00.00.00.00.00.00.00.0...0.01.00.01.00.00.00.00.00.00.0
20.00.00.00.00.00.00.00.00.00.0...1.00.00.01.00.00.01.00.00.00.0
30.00.00.00.00.00.00.00.00.00.0...0.00.00.00.00.00.00.00.00.00.0
40.00.00.00.00.00.00.00.00.00.0...0.01.00.01.00.00.00.00.00.00.0
..................................................................
47560.00.00.00.00.00.00.00.00.00.0...0.00.00.01.00.00.00.00.00.00.0
47570.00.00.00.00.00.00.00.00.00.0...1.01.00.01.00.00.00.00.00.00.0
47580.00.00.00.00.00.00.00.00.00.0...0.00.00.01.00.00.00.00.00.00.0
47590.00.00.00.00.00.00.00.00.00.0...0.01.00.01.00.00.00.00.00.00.0
47600.00.00.00.00.00.00.00.00.00.0...0.01.00.01.01.00.00.00.00.00.0
\n

4761 rows × 26580 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"actors2 = []\n\nfor i in tv['cast']:\n actor2 = re.split(r', \\s*', i)\n actors2.append(actor2)\n \nflat_list5 = []\nfor sublist in actors2:\n for item in sublist:\n flat_list5.append(item)\n \nactors_list2 = sorted(set(flat_list5))\n\nbinary_actors2 = [[0] * 0 for i in range(len(set(flat_list5)))]\n\nfor i in tv['cast']:\n k = 0\n for j in actors_list2:\n if j in i:\n binary_actors2[k].append(1.0)\n else:\n binary_actors2[k].append(0.0)\n k+=1\n \nbinary_actors2 = pd.DataFrame(binary_actors2).transpose()\n \n\ncountries2 = []\n\nfor i in tv['country']:\n country2 = re.split(r', \\s*', i)\n countries2.append(country2)\n \nflat_list6 = []\nfor sublist in countries2:\n for item in sublist:\n flat_list6.append(item)\n \ncountries_list2 = sorted(set(flat_list6))\n\nbinary_countries2 = [[0] * 0 for i in range(len(set(flat_list6)))]\n\nfor i in tv['country']:\n k = 0\n for j in countries_list2:\n if j in i:\n binary_countries2[k].append(1.0)\n else:\n binary_countries2[k].append(0.0)\n k+=1\n \nbinary_countries2 = pd.DataFrame(binary_countries2).transpose()\n\ngenres2 = []\n\nfor i in tv['listed_in']:\n genre2 = re.split(r', \\s*', i)\n genres2.append(genre2)\n \nflat_list7 = []\nfor sublist in genres2:\n for item in sublist:\n flat_list7.append(item)\n \ngenres_list2 = sorted(set(flat_list7))\n\nbinary_genres2 = [[0] * 0 for i in range(len(set(flat_list7)))]\n\nfor i in tv['listed_in']:\n k = 0\n for j in genres_list2:\n if j in i:\n binary_genres2[k].append(1.0)\n else:\n binary_genres2[k].append(0.0)\n k+=1\n \nbinary_genres2 = pd.DataFrame(binary_genres2).transpose()\n\nratings2 = []\n\nfor i in tv['rating']:\n ratings2.append(i)\n\nratings_list2 = sorted(set(ratings2))\n\nbinary_ratings2 = [[0] * 0 for i in range(len(set(ratings_list2)))]\n\nfor i in tv['rating']:\n k = 0\n for j in ratings_list2:\n if j in i:\n binary_ratings2[k].append(1.0)\n else:\n binary_ratings2[k].append(0.0)\n k+=1\n \nbinary_ratings2 = pd.DataFrame(binary_ratings2).transpose()","execution_count":40,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"binary2 = pd.concat([binary_actors2, binary_countries2, binary_genres2], axis=1, ignore_index=True)\nbinary2","execution_count":41,"outputs":[{"output_type":"execute_result","execution_count":41,"data":{"text/plain":" 0 1 2 3 4 5 6 7 8 9 \\\n0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n... ... ... ... ... ... ... ... ... ... ... \n1886 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n1887 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n1888 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n1889 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n1890 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n\n ... 12741 12742 12743 12744 12745 12746 12747 12748 12749 \\\n0 ... 0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0 0.0 \n1 ... 0.0 0.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 \n2 ... 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 \n3 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 \n4 ... 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 \n... ... ... ... ... ... ... ... ... ... ... \n1886 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n1887 ... 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 \n1888 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n1889 ... 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 \n1890 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 \n\n 12750 \n0 0.0 \n1 0.0 \n2 0.0 \n3 0.0 \n4 0.0 \n... ... \n1886 0.0 \n1887 0.0 \n1888 0.0 \n1889 0.0 \n1890 0.0 \n\n[1891 rows x 12751 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
0123456789...12741127421274312744127451274612747127481274912750
00.00.00.00.00.00.00.00.00.00.0...0.00.00.01.00.00.01.01.00.00.0
10.00.00.00.00.00.00.00.00.00.0...0.00.00.01.00.01.00.01.00.00.0
20.00.00.00.00.00.00.00.00.00.0...0.00.00.01.00.00.00.01.00.00.0
30.00.00.00.00.00.00.00.00.00.0...0.00.00.00.00.00.00.01.00.00.0
40.00.00.00.00.00.00.00.00.00.0...0.00.01.00.00.00.00.00.00.00.0
..................................................................
18860.00.00.00.00.00.00.00.00.00.0...0.00.00.00.00.00.00.00.00.00.0
18870.00.00.00.00.00.00.00.00.00.0...0.00.00.01.00.00.00.01.00.00.0
18880.00.00.00.00.00.00.00.00.00.0...0.00.00.00.00.00.00.00.00.00.0
18890.00.00.00.00.00.00.00.00.00.0...1.00.00.00.00.00.00.01.00.00.0
18900.00.00.00.00.00.00.00.00.00.0...0.00.00.00.00.00.00.01.00.00.0
\n

1891 rows × 12751 columns

\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"def recommender(search):\n cs_list = []\n binary_list = []\n if search in movies['title'].values:\n idx = movies[movies['title'] == search].index.item()\n for i in binary.iloc[idx]:\n binary_list.append(i)\n point1 = np.array(binary_list).reshape(1, -1)\n point1 = [val for sublist in point1 for val in sublist] \n for j in range(len(movies)):\n binary_list2 = []\n for k in binary.iloc[j]:\n binary_list2.append(k)\n point2 = np.array(binary_list2).reshape(1, -1)\n point2 = [val for sublist in point2 for val in sublist]\n dot_product = np.dot(point1, point2)\n norm_1 = np.linalg.norm(point1)\n norm_2 = np.linalg.norm(point2)\n cos_sim = dot_product / (norm_1 * norm_2)\n cs_list.append(cos_sim)\n movies_copy = movies.copy()\n movies_copy['cos_sim'] = cs_list\n results = movies_copy.sort_values('cos_sim', ascending=False)\n results = results[results['title'] != search] \n top_results = results.head(5)\n return(top_results)\n elif search in tv['title'].values:\n idx = tv[tv['title'] == search].index.item()\n for i in binary2.iloc[idx]:\n binary_list.append(i)\n point1 = np.array(binary_list).reshape(1, -1)\n point1 = [val for sublist in point1 for val in sublist]\n for j in range(len(tv)):\n binary_list2 = []\n for k in binary2.iloc[j]:\n binary_list2.append(k)\n point2 = np.array(binary_list2).reshape(1, -1)\n point2 = [val for sublist in point2 for val in sublist]\n dot_product = np.dot(point1, point2)\n norm_1 = np.linalg.norm(point1)\n norm_2 = np.linalg.norm(point2)\n cos_sim = dot_product / (norm_1 * norm_2)\n cs_list.append(cos_sim)\n tv_copy = tv.copy()\n tv_copy['cos_sim'] = cs_list\n results = tv_copy.sort_values('cos_sim', ascending=False)\n results = results[results['title'] != search] \n top_results = results.head(5)\n return(top_results)\n else:\n return(\"Title not in dataset. Please check spelling.\")","execution_count":42,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## 4.1. Recommending Movies"},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('The Conjuring')","execution_count":43,"outputs":[{"output_type":"execute_result","execution_count":43,"data":{"text/plain":" title director \\\n1868 Insidious James Wan \n968 Creep Patrick Brice \n1844 In the Tall Grass Vincenzo Natali \n969 Creep 2 Patrick Brice \n1077 Desolation Sam Patton \n\n cast \\\n1868 Patrick Wilson, Rose Byrne, Lin Shaye, Ty Simp... \n968 Mark Duplass, Patrick Brice \n1844 Patrick Wilson, Laysla De Oliveira, Avery Whit... \n969 Mark Duplass, Desiree Akhavan, Karan Soni \n1077 Jaimi Paige, Alyshia Ochse, Toby Nichols, Clau... \n\n country rating \\\n1868 United States, Canada, United Kingdom PG-13 \n968 United States R \n1844 Canada, United States TV-MA \n969 United States TV-MA \n1077 United States TV-MA \n\n listed_in cos_sim \n1868 Horror Movies, Thrillers 0.388922 \n968 Horror Movies, Independent Movies, Thrillers 0.377964 \n1844 Horror Movies, Thrillers 0.370625 \n969 Horror Movies, Independent Movies, Thrillers 0.356348 \n1077 Horror Movies, Thrillers 0.356348 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
1868InsidiousJames WanPatrick Wilson, Rose Byrne, Lin Shaye, Ty Simp...United States, Canada, United KingdomPG-13Horror Movies, Thrillers0.388922
968CreepPatrick BriceMark Duplass, Patrick BriceUnited StatesRHorror Movies, Independent Movies, Thrillers0.377964
1844In the Tall GrassVincenzo NataliPatrick Wilson, Laysla De Oliveira, Avery Whit...Canada, United StatesTV-MAHorror Movies, Thrillers0.370625
969Creep 2Patrick BriceMark Duplass, Desiree Akhavan, Karan SoniUnited StatesTV-MAHorror Movies, Independent Movies, Thrillers0.356348
1077DesolationSam PattonJaimi Paige, Alyshia Ochse, Toby Nichols, Clau...United StatesTV-MAHorror Movies, Thrillers0.356348
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender(\"Child's Play\")","execution_count":44,"outputs":[{"output_type":"execute_result","execution_count":44,"data":{"text/plain":" title director \\\n975 Cult of Chucky Don Mancini \n4669 Wildling Fritz Böhm \n3592 Stephanie Akiva Goldsman \n789 Candyman Bernard Rose \n968 Creep Patrick Brice \n\n cast \\\n975 Fiona Dourif, Michael Therriault, Adam Hurtig,... \n4669 Bel Powley, Brad Dourif, Liv Tyler, Collin Kel... \n3592 Shree Cooks, Frank Grillo, Anna Torv \n789 Virginia Madsen, Tony Todd, Xander Berkeley, K... \n968 Mark Duplass, Patrick Brice \n\n country rating \\\n975 United States R \n4669 United States R \n3592 United States R \n789 United States, United Kingdom R \n968 United States R \n\n listed_in cos_sim \n975 Horror Movies 0.312500 \n4669 Horror Movies, Independent Movies, Sci-Fi & Fa... 0.301511 \n3592 Horror Movies 0.283473 \n789 Cult Movies, Horror Movies 0.267261 \n968 Horror Movies, Independent Movies, Thrillers 0.265165 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
975Cult of ChuckyDon ManciniFiona Dourif, Michael Therriault, Adam Hurtig,...United StatesRHorror Movies0.312500
4669WildlingFritz BöhmBel Powley, Brad Dourif, Liv Tyler, Collin Kel...United StatesRHorror Movies, Independent Movies, Sci-Fi & Fa...0.301511
3592StephanieAkiva GoldsmanShree Cooks, Frank Grillo, Anna TorvUnited StatesRHorror Movies0.283473
789CandymanBernard RoseVirginia Madsen, Tony Todd, Xander Berkeley, K...United States, United KingdomRCult Movies, Horror Movies0.267261
968CreepPatrick BriceMark Duplass, Patrick BriceUnited StatesRHorror Movies, Independent Movies, Thrillers0.265165
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Charlie and the Chocolate Factory')","execution_count":45,"outputs":[{"output_type":"execute_result","execution_count":45,"data":{"text/plain":" title director \\\n3661 Sweeney Todd: The Demon Barber of Fleet Street Tim Burton \n1346 Figaro Pho Luke Jurevicius \n2983 Penelope Mark Palansky \n1557 Goosebumps 2: Haunted Halloween Ari Sandel \n1767 Hugo Martin Scorsese \n\n cast \\\n3661 Johnny Depp, Helena Bonham Carter, Alan Rickma... \n1346 Luke Jurevicius \n2983 Christina Ricci, James McAvoy, Catherine O'Har... \n1557 Jeremy Ray Taylor, Madison Iseman, Caleel Harr... \n1767 Ben Kingsley, Sacha Baron Cohen, Asa Butterfie... \n\n country rating \\\n3661 United States, United Kingdom R \n1346 United Kingdom TV-Y7 \n2983 United Kingdom, United States PG \n1557 United States, United Kingdom PG \n1767 United Kingdom, United States, France PG \n\n listed_in cos_sim \n3661 Dramas, Horror Movies, Music & Musicals 0.360041 \n1346 Children & Family Movies, Comedies 0.356348 \n2983 Children & Family Movies, Comedies, Romantic M... 0.314970 \n1557 Children & Family Movies, Comedies 0.302614 \n1767 Children & Family Movies, Dramas 0.293972 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
3661Sweeney Todd: The Demon Barber of Fleet StreetTim BurtonJohnny Depp, Helena Bonham Carter, Alan Rickma...United States, United KingdomRDramas, Horror Movies, Music & Musicals0.360041
1346Figaro PhoLuke JureviciusLuke JureviciusUnited KingdomTV-Y7Children & Family Movies, Comedies0.356348
2983PenelopeMark PalanskyChristina Ricci, James McAvoy, Catherine O'Har...United Kingdom, United StatesPGChildren & Family Movies, Comedies, Romantic M...0.314970
1557Goosebumps 2: Haunted HalloweenAri SandelJeremy Ray Taylor, Madison Iseman, Caleel Harr...United States, United KingdomPGChildren & Family Movies, Comedies0.302614
1767HugoMartin ScorseseBen Kingsley, Sacha Baron Cohen, Asa Butterfie...United Kingdom, United States, FrancePGChildren & Family Movies, Dramas0.293972
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Wild Child')","execution_count":46,"outputs":[{"output_type":"execute_result","execution_count":46,"data":{"text/plain":" title director \\\n4018 The Kissing Booth Vince Marcello \n2983 Penelope Mark Palansky \n4019 The Kissing Booth 2 Vince Marcello \n3959 The Guernsey Literary and Potato Peel Pie Society Mike Newell \n1714 Holidate John Whitesell \n\n cast \\\n4018 Joey King, Joel Courtney, Jacob Elordi, Molly ... \n2983 Christina Ricci, James McAvoy, Catherine O'Har... \n4019 Joey King, Joel Courtney, Jacob Elordi, Molly ... \n3959 Lily James, Michiel Huisman, Penelope Wilton, ... \n1714 Emma Roberts, Luke Bracey, Kristin Chenoweth, ... \n\n country rating \\\n4018 United Kingdom, United States TV-14 \n2983 United Kingdom, United States PG \n4019 United Kingdom, United States TV-14 \n3959 United Kingdom, France, United States TV-PG \n1714 United States TV-MA \n\n listed_in cos_sim \n4018 Comedies, Romantic Movies 0.353553 \n2983 Children & Family Movies, Comedies, Romantic M... 0.322749 \n4019 Comedies, Romantic Movies 0.310087 \n3959 Dramas, Romantic Movies 0.298807 \n1714 Comedies, Romantic Movies 0.298807 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
4018The Kissing BoothVince MarcelloJoey King, Joel Courtney, Jacob Elordi, Molly ...United Kingdom, United StatesTV-14Comedies, Romantic Movies0.353553
2983PenelopeMark PalanskyChristina Ricci, James McAvoy, Catherine O'Har...United Kingdom, United StatesPGChildren & Family Movies, Comedies, Romantic M...0.322749
4019The Kissing Booth 2Vince MarcelloJoey King, Joel Courtney, Jacob Elordi, Molly ...United Kingdom, United StatesTV-14Comedies, Romantic Movies0.310087
3959The Guernsey Literary and Potato Peel Pie SocietyMike NewellLily James, Michiel Huisman, Penelope Wilton, ...United Kingdom, France, United StatesTV-PGDramas, Romantic Movies0.298807
1714HolidateJohn WhitesellEmma Roberts, Luke Bracey, Kristin Chenoweth, ...United StatesTV-MAComedies, Romantic Movies0.298807
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender(\"Dr. Seuss' The Cat in the Hat\")","execution_count":47,"outputs":[{"output_type":"execute_result","execution_count":47,"data":{"text/plain":" title director \\\n2798 NOVA: Bird Brain NaN \n3624 Sugar High Ariel Boles \n4758 Zoom Peter Hewitt \n4624 What a Girl Wants Dennie Gordon \n3066 Prince of Peoria: A Christmas Moose Miracle Jon Rosenbaum \n\n cast \\\n2798 Craig Sechler \n3624 Hunter March \n4758 Tim Allen, Courteney Cox, Chevy Chase, Kate Ma... \n4624 Amanda Bynes, Colin Firth, Kelly Preston, Eile... \n3066 Gavin Lewis, Theodore Barnes, Shelby Simmons, ... \n\n country rating \\\n2798 United States TV-G \n3624 United States TV-G \n4758 United States PG \n4624 United States, United Kingdom PG \n3066 United States TV-G \n\n listed_in cos_sim \n2798 Children & Family Movies, Documentaries 0.372104 \n3624 Children & Family Movies 0.372104 \n4758 Children & Family Movies, Comedies 0.370625 \n4624 Children & Family Movies, Comedies 0.370625 \n3066 Children & Family Movies, Comedies 0.369800 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
2798NOVA: Bird BrainNaNCraig SechlerUnited StatesTV-GChildren & Family Movies, Documentaries0.372104
3624Sugar HighAriel BolesHunter MarchUnited StatesTV-GChildren & Family Movies0.372104
4758ZoomPeter HewittTim Allen, Courteney Cox, Chevy Chase, Kate Ma...United StatesPGChildren & Family Movies, Comedies0.370625
4624What a Girl WantsDennie GordonAmanda Bynes, Colin Firth, Kelly Preston, Eile...United States, United KingdomPGChildren & Family Movies, Comedies0.370625
3066Prince of Peoria: A Christmas Moose MiracleJon RosenbaumGavin Lewis, Theodore Barnes, Shelby Simmons, ...United StatesTV-GChildren & Family Movies, Comedies0.369800
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Hook')","execution_count":48,"outputs":[{"output_type":"execute_result","execution_count":48,"data":{"text/plain":" title director \\\n477 Balto Simon Wells \n3624 Sugar High Ariel Boles \n2798 NOVA: Bird Brain NaN \n1001 Dance Dreams: Hot Chocolate Nutcracker Oliver Bokelberg \n562 Benji's Very Own Christmas Story Joe Camp \n\n cast country rating \\\n477 Kevin Bacon, Bob Hoskins, Bridget Fonda, Jim C... United States G \n3624 Hunter March United States TV-G \n2798 Craig Sechler United States TV-G \n1001 Debbie Allen United States TV-G \n562 Ron Moody, Patsy Garrett, Cynthia Smith United States TV-G \n\n listed_in cos_sim \n477 Children & Family Movies, Dramas 0.370625 \n3624 Children & Family Movies 0.358569 \n2798 Children & Family Movies, Documentaries 0.358569 \n1001 Children & Family Movies, Documentaries 0.327327 \n562 Children & Family Movies 0.303046 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
477BaltoSimon WellsKevin Bacon, Bob Hoskins, Bridget Fonda, Jim C...United StatesGChildren & Family Movies, Dramas0.370625
3624Sugar HighAriel BolesHunter MarchUnited StatesTV-GChildren & Family Movies0.358569
2798NOVA: Bird BrainNaNCraig SechlerUnited StatesTV-GChildren & Family Movies, Documentaries0.358569
1001Dance Dreams: Hot Chocolate NutcrackerOliver BokelbergDebbie AllenUnited StatesTV-GChildren & Family Movies, Documentaries0.327327
562Benji's Very Own Christmas StoryJoe CampRon Moody, Patsy Garrett, Cynthia SmithUnited StatesTV-GChildren & Family Movies0.303046
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Holidate')","execution_count":49,"outputs":[{"output_type":"execute_result","execution_count":49,"data":{"text/plain":" title director \\\n4646 When We First Met Ari Sandel \n1360 First Impression Arthur Muhammad \n3606 Stranger than Fiction Marc Forster \n4018 The Kissing Booth Vince Marcello \n3946 The Good Catholic Paul Shoulberg \n\n cast \\\n4646 Adam DeVine, Alexandra Daddario, Shelley Henni... \n1360 Lamman Rucker, Lisa Arrindell Anderson, Elise ... \n3606 Will Ferrell, Maggie Gyllenhaal, Dustin Hoffma... \n4018 Joey King, Joel Courtney, Jacob Elordi, Molly ... \n3946 Zachary Spicer, Wrenn Schmidt, Danny Glover, J... \n\n country rating listed_in \\\n4646 United States TV-14 Comedies, Romantic Movies \n1360 United States TV-14 Comedies, Romantic Movies \n3606 United States, United Kingdom PG-13 Comedies, Romantic Movies \n4018 United Kingdom, United States TV-14 Comedies, Romantic Movies \n3946 United States PG-13 Comedies, Dramas, Romantic Movies \n\n cos_sim \n4646 0.422577 \n1360 0.356348 \n3606 0.345033 \n4018 0.338062 \n3946 0.338062 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
4646When We First MetAri SandelAdam DeVine, Alexandra Daddario, Shelley Henni...United StatesTV-14Comedies, Romantic Movies0.422577
1360First ImpressionArthur MuhammadLamman Rucker, Lisa Arrindell Anderson, Elise ...United StatesTV-14Comedies, Romantic Movies0.356348
3606Stranger than FictionMarc ForsterWill Ferrell, Maggie Gyllenhaal, Dustin Hoffma...United States, United KingdomPG-13Comedies, Romantic Movies0.345033
4018The Kissing BoothVince MarcelloJoey King, Joel Courtney, Jacob Elordi, Molly ...United Kingdom, United StatesTV-14Comedies, Romantic Movies0.338062
3946The Good CatholicPaul ShoulbergZachary Spicer, Wrenn Schmidt, Danny Glover, J...United StatesPG-13Comedies, Dramas, Romantic Movies0.338062
\n
"},"metadata":{}}]},{"metadata":{},"cell_type":"markdown","source":"## 4.2. Recommending TV shows"},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('After Life')","execution_count":50,"outputs":[{"output_type":"execute_result","execution_count":50,"data":{"text/plain":" title director \\\n468 Extras NaN \n1468 The Blue Planet: A Natural History of the Oceans Alastair Fothergill \n578 Grand Designs NaN \n1007 My Hotter Half NaN \n62 Ainsley Eats the Streets NaN \n\n cast \\\n468 Ricky Gervais, Stephen Merchant, Ashley Jensen... \n1468 David Attenborough \n578 Kevin McCloud \n1007 Melvin Odoom \n62 Ainsley Harriott \n\n country rating \\\n468 United Kingdom, United States TV-MA \n1468 United Kingdom TV-G \n578 United Kingdom TV-14 \n1007 United Kingdom TV-PG \n62 United Kingdom TV-PG \n\n listed_in cos_sim \n468 British TV Shows, TV Comedies 0.526235 \n1468 British TV Shows, Docuseries, International TV... 0.452911 \n578 British TV Shows, International TV Shows, Real... 0.452911 \n1007 British TV Shows, International TV Shows, Real... 0.452911 \n62 British TV Shows, Docuseries, International TV... 0.452911 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
468ExtrasNaNRicky Gervais, Stephen Merchant, Ashley Jensen...United Kingdom, United StatesTV-MABritish TV Shows, TV Comedies0.526235
1468The Blue Planet: A Natural History of the OceansAlastair FothergillDavid AttenboroughUnited KingdomTV-GBritish TV Shows, Docuseries, International TV...0.452911
578Grand DesignsNaNKevin McCloudUnited KingdomTV-14British TV Shows, International TV Shows, Real...0.452911
1007My Hotter HalfNaNMelvin OdoomUnited KingdomTV-PGBritish TV Shows, International TV Shows, Real...0.452911
62Ainsley Eats the StreetsNaNAinsley HarriottUnited KingdomTV-PGBritish TV Shows, Docuseries, International TV...0.452911
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Anne with an E')","execution_count":51,"outputs":[{"output_type":"execute_result","execution_count":51,"data":{"text/plain":" title director \\\n254 Can You Hear Me? NaN \n1229 Restaurants on the Edge NaN \n185 Bitten NaN \n622 Heavy Rescue: 401 NaN \n645 Hip-Hop Evolution NaN \n\n cast country rating \\\n254 Mélissa Bédard, Ève Landry, Florence Longpré Canada TV-MA \n1229 Nick Liberato, Karin Bohn, Dennis Prescott Canada TV-14 \n185 Laura Vandervoort, Greyston Holt, Greg Bryk, S... Canada TV-MA \n622 Dave Pettitt Canada TV-MA \n645 Shad Kabango Canada TV-MA \n\n listed_in cos_sim \n254 International TV Shows, TV Comedies, TV Dramas 0.462250 \n1229 International TV Shows, Reality TV 0.392232 \n185 International TV Shows, TV Dramas, TV Horror 0.384615 \n622 International TV Shows, Reality TV 0.372104 \n645 Docuseries, International TV Shows 0.372104 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
254Can You Hear Me?NaNMélissa Bédard, Ève Landry, Florence LongpréCanadaTV-MAInternational TV Shows, TV Comedies, TV Dramas0.462250
1229Restaurants on the EdgeNaNNick Liberato, Karin Bohn, Dennis PrescottCanadaTV-14International TV Shows, Reality TV0.392232
185BittenNaNLaura Vandervoort, Greyston Holt, Greg Bryk, S...CanadaTV-MAInternational TV Shows, TV Dramas, TV Horror0.384615
622Heavy Rescue: 401NaNDave PettittCanadaTV-MAInternational TV Shows, Reality TV0.372104
645Hip-Hop EvolutionNaNShad KabangoCanadaTV-MADocuseries, International TV Shows0.372104
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Gilmore Girls')","execution_count":52,"outputs":[{"output_type":"execute_result","execution_count":52,"data":{"text/plain":" title director \\\n542 Gilmore Girls: A Year in the Life NaN \n863 Love NaN \n1061 No Tomorrow NaN \n361 DASH & LILY NaN \n664 Hot Date NaN \n\n cast country rating \\\n542 Lauren Graham, Alexis Bledel, Kelly Bishop, Sc... United States TV-14 \n863 Gillian Jacobs, Paul Rust, Claudia O'Doherty United States TV-MA \n1061 Joshua Sasse, Tori Anderson, Jonathan Langdon,... United States TV-PG \n361 Midori Francis, Austin Abrams, Dante Brown, Tr... United States TV-14 \n664 Emily Axford, Brian Murphy United States TV-MA \n\n listed_in cos_sim \n542 TV Comedies, TV Dramas, Teen TV Shows 0.777778 \n863 Romantic TV Shows, TV Comedies, TV Dramas 0.416667 \n1061 Romantic TV Shows, TV Comedies, TV Dramas 0.408248 \n361 Romantic TV Shows, TV Comedies, TV Dramas 0.392837 \n664 Romantic TV Shows, TV Comedies 0.384900 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
542Gilmore Girls: A Year in the LifeNaNLauren Graham, Alexis Bledel, Kelly Bishop, Sc...United StatesTV-14TV Comedies, TV Dramas, Teen TV Shows0.777778
863LoveNaNGillian Jacobs, Paul Rust, Claudia O'DohertyUnited StatesTV-MARomantic TV Shows, TV Comedies, TV Dramas0.416667
1061No TomorrowNaNJoshua Sasse, Tori Anderson, Jonathan Langdon,...United StatesTV-PGRomantic TV Shows, TV Comedies, TV Dramas0.408248
361DASH & LILYNaNMidori Francis, Austin Abrams, Dante Brown, Tr...United StatesTV-14Romantic TV Shows, TV Comedies, TV Dramas0.392837
664Hot DateNaNEmily Axford, Brian MurphyUnited StatesTV-MARomantic TV Shows, TV Comedies0.384900
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Friends')","execution_count":53,"outputs":[{"output_type":"execute_result","execution_count":53,"data":{"text/plain":" title director \\\n455 Episodes NaN \n1133 Pee-wee's Playhouse NaN \n513 Frasier NaN \n910 Man with a Plan NaN \n1550 The Honeymoon Stand Up Special NaN \n\n cast \\\n455 Matt LeBlanc, Tamsin Greig, Stephen Mangan, Ka... \n1133 Paul Reubens \n513 Kelsey Grammer, Jane Leeves, David Hyde Pierce... \n910 Matt LeBlanc, Liza Snyder, Grace Kaufman, Matt... \n1550 Natasha Leggero, Moshe Kasher \n\n country rating \\\n455 United Kingdom, United States TV-MA \n1133 United States TV-PG \n513 United States TV-PG \n910 United States TV-PG \n1550 United States TV-MA \n\n listed_in cos_sim \n455 Classic & Cult TV, TV Comedies 0.476731 \n1133 Classic & Cult TV, Kids' TV, TV Comedies 0.424264 \n513 Classic & Cult TV, TV Comedies 0.400000 \n910 TV Comedies 0.400000 \n1550 Stand-Up Comedy & Talk Shows, TV Comedies 0.387298 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
455EpisodesNaNMatt LeBlanc, Tamsin Greig, Stephen Mangan, Ka...United Kingdom, United StatesTV-MAClassic & Cult TV, TV Comedies0.476731
1133Pee-wee's PlayhouseNaNPaul ReubensUnited StatesTV-PGClassic & Cult TV, Kids' TV, TV Comedies0.424264
513FrasierNaNKelsey Grammer, Jane Leeves, David Hyde Pierce...United StatesTV-PGClassic & Cult TV, TV Comedies0.400000
910Man with a PlanNaNMatt LeBlanc, Liza Snyder, Grace Kaufman, Matt...United StatesTV-PGTV Comedies0.400000
1550The Honeymoon Stand Up SpecialNaNNatasha Leggero, Moshe KasherUnited StatesTV-MAStand-Up Comedy & Talk Shows, TV Comedies0.387298
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Love on the Spectrum')","execution_count":54,"outputs":[{"output_type":"execute_result","execution_count":54,"data":{"text/plain":" title director cast \\\n278 Cheapest Weddings NaN Melanie Vallejo \n1890 Zumbo's Just Desserts NaN Adriano Zumbo, Rachel Khoo \n1782 Vai Anitta NaN Anitta \n326 Court Justice NaN Chris Bourke \n21 72 Dangerous Animals: Asia NaN Bob Brisbane \n\n country rating listed_in \\\n278 Australia TV-14 International TV Shows, Reality TV \n1890 Australia TV-PG International TV Shows, Reality TV \n1782 Brazil TV-MA Docuseries, International TV Shows, Reality TV \n326 Australia TV-MA Crime TV Shows, Docuseries, International TV S... \n21 Australia TV-14 Docuseries, International TV Shows, Science & ... \n\n cos_sim \n278 0.730297 \n1890 0.666667 \n1782 0.666667 \n326 0.666667 \n21 0.666667 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
278Cheapest WeddingsNaNMelanie VallejoAustraliaTV-14International TV Shows, Reality TV0.730297
1890Zumbo's Just DessertsNaNAdriano Zumbo, Rachel KhooAustraliaTV-PGInternational TV Shows, Reality TV0.666667
1782Vai AnittaNaNAnittaBrazilTV-MADocuseries, International TV Shows, Reality TV0.666667
326Court JusticeNaNChris BourkeAustraliaTV-MACrime TV Shows, Docuseries, International TV S...0.666667
2172 Dangerous Animals: AsiaNaNBob BrisbaneAustraliaTV-14Docuseries, International TV Shows, Science & ...0.666667
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('13 Reasons Why')","execution_count":55,"outputs":[{"output_type":"execute_result","execution_count":55,"data":{"text/plain":" title director \\\n11 13 Reasons Why: Beyond the Reasons NaN \n515 Frequency NaN \n1653 The Sinner NaN \n964 MINDHUNTER NaN \n1775 Unsolved NaN \n\n cast country rating \\\n11 Dylan Minnette, Katherine Langford, Kate Walsh... United States TV-MA \n515 Peyton List, Riley Smith, Mekhi Phifer, Devin ... United States TV-14 \n1653 Jessica Biel, Bill Pullman, Christopher Abbott... United States TV-MA \n964 Jonathan Groff, Holt McCallany, Anna Torv, Cot... United States TV-MA \n1775 Josh Duhamel, Jimmi Simpson, Bokeem Woodbine United States TV-MA \n\n listed_in cos_sim \n11 Crime TV Shows, Docuseries 0.432789 \n515 Crime TV Shows, TV Dramas, TV Mysteries 0.381771 \n1653 Crime TV Shows, TV Dramas, TV Mysteries 0.362738 \n964 Crime TV Shows, TV Dramas, TV Mysteries 0.362738 \n1775 Crime TV Shows, TV Dramas 0.346844 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
1113 Reasons Why: Beyond the ReasonsNaNDylan Minnette, Katherine Langford, Kate Walsh...United StatesTV-MACrime TV Shows, Docuseries0.432789
515FrequencyNaNPeyton List, Riley Smith, Mekhi Phifer, Devin ...United StatesTV-14Crime TV Shows, TV Dramas, TV Mysteries0.381771
1653The SinnerNaNJessica Biel, Bill Pullman, Christopher Abbott...United StatesTV-MACrime TV Shows, TV Dramas, TV Mysteries0.362738
964MINDHUNTERNaNJonathan Groff, Holt McCallany, Anna Torv, Cot...United StatesTV-MACrime TV Shows, TV Dramas, TV Mysteries0.362738
1775UnsolvedNaNJosh Duhamel, Jimmi Simpson, Bokeem WoodbineUnited StatesTV-MACrime TV Shows, TV Dramas0.346844
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Derry Girls')","execution_count":56,"outputs":[{"output_type":"execute_result","execution_count":56,"data":{"text/plain":" title director \\\n332 Crazyhead NaN \n852 Loaded NaN \n502 Flowers NaN \n180 Big Dreams, Small Spaces NaN \n985 Monty Don's Italian Gardens NaN \n\n cast country rating \\\n332 Cara Theobold, Susan Wokoma, Riann Steele, Ari... United Kingdom TV-MA \n852 Jim Howick, Samuel Anderson, Jonny Sweet, Nick... United Kingdom TV-MA \n502 Olivia Colman, Julian Barratt, Daniel Rigby, S... United Kingdom TV-MA \n180 Monty Don United Kingdom TV-G \n985 Monty Don United Kingdom TV-G \n\n listed_in cos_sim \n332 British TV Shows, International TV Shows, TV C... 0.420084 \n852 British TV Shows, International TV Shows, TV C... 0.403604 \n502 British TV Shows, International TV Shows, TV C... 0.403604 \n180 British TV Shows, International TV Shows, Real... 0.396059 \n985 British TV Shows, Docuseries, International TV... 0.396059 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
332CrazyheadNaNCara Theobold, Susan Wokoma, Riann Steele, Ari...United KingdomTV-MABritish TV Shows, International TV Shows, TV C...0.420084
852LoadedNaNJim Howick, Samuel Anderson, Jonny Sweet, Nick...United KingdomTV-MABritish TV Shows, International TV Shows, TV C...0.403604
502FlowersNaNOlivia Colman, Julian Barratt, Daniel Rigby, S...United KingdomTV-MABritish TV Shows, International TV Shows, TV C...0.403604
180Big Dreams, Small SpacesNaNMonty DonUnited KingdomTV-GBritish TV Shows, International TV Shows, Real...0.396059
985Monty Don's Italian GardensNaNMonty DonUnited KingdomTV-GBritish TV Shows, Docuseries, International TV...0.396059
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Breaking Bad')","execution_count":57,"outputs":[{"output_type":"execute_result","execution_count":57,"data":{"text/plain":" title director \\\n169 Better Call Saul NaN \n1459 The Assassination of Gianni Versace NaN \n1775 Unsolved NaN \n537 Get Shorty NaN \n1416 Surviving R. Kelly NaN \n\n cast country rating \\\n169 Bob Odenkirk, Jonathan Banks, Michael McKean, ... United States TV-MA \n1459 Edgar Ramírez, Darren Criss, Ricky Martin, Pen... United States TV-MA \n1775 Josh Duhamel, Jimmi Simpson, Bokeem Woodbine United States TV-MA \n537 Ray Romano, Chris O'Dowd United States TV-MA \n1416 R. Kelly United States TV-MA \n\n listed_in cos_sim \n169 Crime TV Shows, TV Comedies, TV Dramas 0.521749 \n1459 Crime TV Shows, TV Dramas, TV Thrillers 0.430331 \n1775 Crime TV Shows, TV Dramas 0.390360 \n537 Crime TV Shows, TV Comedies, TV Dramas 0.390360 \n1416 Crime TV Shows, Docuseries 0.346410 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
169Better Call SaulNaNBob Odenkirk, Jonathan Banks, Michael McKean, ...United StatesTV-MACrime TV Shows, TV Comedies, TV Dramas0.521749
1459The Assassination of Gianni VersaceNaNEdgar Ramírez, Darren Criss, Ricky Martin, Pen...United StatesTV-MACrime TV Shows, TV Dramas, TV Thrillers0.430331
1775UnsolvedNaNJosh Duhamel, Jimmi Simpson, Bokeem WoodbineUnited StatesTV-MACrime TV Shows, TV Dramas0.390360
537Get ShortyNaNRay Romano, Chris O'DowdUnited StatesTV-MACrime TV Shows, TV Comedies, TV Dramas0.390360
1416Surviving R. KellyNaNR. KellyUnited StatesTV-MACrime TV Shows, Docuseries0.346410
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender('Stranger Things')","execution_count":58,"outputs":[{"output_type":"execute_result","execution_count":58,"data":{"text/plain":" title director \\\n175 Beyond Stranger Things NaN \n1174 Prank Encounters NaN \n625 Helix NaN \n1811 Warrior Nun NaN \n292 Chilling Adventures of Sabrina NaN \n\n cast \\\n175 Jim Rash, Matt Duffer, Ross Duffer, Shawn Levy... \n1174 Gaten Matarazzo \n625 Billy Campbell, Hiroyuki Sanada, Kyra Zagorsky... \n1811 Alba Baptista, Toya Turner, Lorena Andrea, Kri... \n292 Kiernan Shipka, Ross Lynch, Miranda Otto, Lucy... \n\n country rating \\\n175 United States TV-14 \n1174 United States TV-MA \n625 United States, Canada TV-MA \n1811 United States TV-MA \n292 United States TV-14 \n\n listed_in cos_sim \n175 Stand-Up Comedy & Talk Shows, TV Mysteries, TV... 0.741941 \n1174 Reality TV, TV Comedies, TV Horror 0.292770 \n625 TV Horror, TV Mysteries, TV Sci-Fi & Fantasy 0.264628 \n1811 TV Action & Adventure, TV Mysteries, TV Sci-Fi... 0.251976 \n292 TV Horror, TV Mysteries, TV Sci-Fi & Fantasy 0.250313 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledirectorcastcountryratinglisted_incos_sim
175Beyond Stranger ThingsNaNJim Rash, Matt Duffer, Ross Duffer, Shawn Levy...United StatesTV-14Stand-Up Comedy & Talk Shows, TV Mysteries, TV...0.741941
1174Prank EncountersNaNGaten MatarazzoUnited StatesTV-MAReality TV, TV Comedies, TV Horror0.292770
625HelixNaNBilly Campbell, Hiroyuki Sanada, Kyra Zagorsky...United States, CanadaTV-MATV Horror, TV Mysteries, TV Sci-Fi & Fantasy0.264628
1811Warrior NunNaNAlba Baptista, Toya Turner, Lorena Andrea, Kri...United StatesTV-MATV Action & Adventure, TV Mysteries, TV Sci-Fi...0.251976
292Chilling Adventures of SabrinaNaNKiernan Shipka, Ross Lynch, Miranda Otto, Lucy...United StatesTV-14TV Horror, TV Mysteries, TV Sci-Fi & Fantasy0.250313
\n
"},"metadata":{}}]},{"metadata":{},"cell_type":"markdown","source":"# 5. Developing Recommendation Engine using *Movie/TV show descriptions*"},{"metadata":{"trusted":true},"cell_type":"code","source":"movies_des = data[data['type'] == 'Movie'].reset_index()\nmovies_des = movies_des[['title', 'description']]\nmovies_des.head()","execution_count":59,"outputs":[{"output_type":"execute_result","execution_count":59,"data":{"text/plain":" title description\n0 7:19 After a devastating earthquake hits Mexico Cit...\n1 23:59 When an army recruit is found dead, his fellow...\n2 9 In a postapocalyptic world, rag-doll robots hi...\n3 21 A brilliant group of students become card-coun...\n4 122 After an awful accident, a couple admitted to ...","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescription
07:19After a devastating earthquake hits Mexico Cit...
123:59When an army recruit is found dead, his fellow...
29In a postapocalyptic world, rag-doll robots hi...
321A brilliant group of students become card-coun...
4122After an awful accident, a couple admitted to ...
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"tv_des = data[data['type'] == 'TV Show'].reset_index()\ntv_des = tv_des[['title', 'description']]\ntv_des.head()","execution_count":60,"outputs":[{"output_type":"execute_result","execution_count":60,"data":{"text/plain":" title \\\n0 3% \n1 46 \n2 1983 \n3 ​SAINT SEIYA: Knights of the Zodiac \n4 #blackAF \n\n description \n0 In a future where the elite inhabit an island ... \n1 A genetics professor experiments with a treatm... \n2 In this dark alt-history thriller, a naïve law... \n3 Seiya and the Knights of the Zodiac rise again... \n4 Kenya Barris and his family navigate relations... ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescription
03%In a future where the elite inhabit an island ...
146A genetics professor experiments with a treatm...
21983In this dark alt-history thriller, a naïve law...
3​SAINT SEIYA: Knights of the ZodiacSeiya and the Knights of the Zodiac rise again...
4#blackAFKenya Barris and his family navigate relations...
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"filtered_movies = []\nmovies_words = []\n\nfor text in movies_des['description']:\n text_tokens = word_tokenize(text)\n tokens_without_sw = [word.lower() for word in text_tokens if not word in stopwords.words()]\n movies_words.append(tokens_without_sw)\n filtered = (\" \").join(tokens_without_sw)\n filtered_movies.append(filtered)\n\nmovies_words = [val for sublist in movies_words for val in sublist]\nmovies_words = sorted(set(movies_words))\nmovies_des['description_filtered'] = filtered_movies\nmovies_des.head()","execution_count":61,"outputs":[{"output_type":"execute_result","execution_count":61,"data":{"text/plain":" title description \\\n0 7:19 After a devastating earthquake hits Mexico Cit... \n1 23:59 When an army recruit is found dead, his fellow... \n2 9 In a postapocalyptic world, rag-doll robots hi... \n3 21 A brilliant group of students become card-coun... \n4 122 After an awful accident, a couple admitted to ... \n\n description_filtered \n0 after devastating earthquake hits mexico city ... \n1 when army recruit found dead , fellow soldiers... \n2 in postapocalyptic world , rag-doll robots hid... \n3 a brilliant group students become card-countin... \n4 after awful accident , couple admitted grisly ... ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filtered
07:19After a devastating earthquake hits Mexico Cit...after devastating earthquake hits mexico city ...
123:59When an army recruit is found dead, his fellow...when army recruit found dead , fellow soldiers...
29In a postapocalyptic world, rag-doll robots hi...in postapocalyptic world , rag-doll robots hid...
321A brilliant group of students become card-coun...a brilliant group students become card-countin...
4122After an awful accident, a couple admitted to ...after awful accident , couple admitted grisly ...
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"filtered_tv = []\ntv_words = []\n\nfor text in tv_des['description']:\n text_tokens = word_tokenize(text)\n tokens_without_sw = [word.lower() for word in text_tokens if not word in stopwords.words()]\n tv_words.append(tokens_without_sw)\n filtered = (\" \").join(tokens_without_sw)\n filtered_tv.append(filtered)\n\ntv_words = [val for sublist in tv_words for val in sublist]\ntv_words = sorted(set(tv_words))\ntv_des['description_filtered'] = filtered_tv\ntv_des.head()","execution_count":62,"outputs":[{"output_type":"execute_result","execution_count":62,"data":{"text/plain":" title \\\n0 3% \n1 46 \n2 1983 \n3 ​SAINT SEIYA: Knights of the Zodiac \n4 #blackAF \n\n description \\\n0 In a future where the elite inhabit an island ... \n1 A genetics professor experiments with a treatm... \n2 In this dark alt-history thriller, a naïve law... \n3 Seiya and the Knights of the Zodiac rise again... \n4 Kenya Barris and his family navigate relations... \n\n description_filtered \n0 in future elite inhabit island paradise far cr... \n1 a genetics professor experiments treatment com... \n2 in dark alt-history thriller , naïve law stude... \n3 seiya knights zodiac rise protect reincarnatio... \n4 kenya barris family navigate relationships , r... ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filtered
03%In a future where the elite inhabit an island ...in future elite inhabit island paradise far cr...
146A genetics professor experiments with a treatm...a genetics professor experiments treatment com...
21983In this dark alt-history thriller, a naïve law...in dark alt-history thriller , naïve law stude...
3​SAINT SEIYA: Knights of the ZodiacSeiya and the Knights of the Zodiac rise again...seiya knights zodiac rise protect reincarnatio...
4#blackAFKenya Barris and his family navigate relations...kenya barris family navigate relationships , r...
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"movie_word_binary = [[0] * 0 for i in range(len(set(movies_words)))]\n\nfor des in movies_des['description_filtered']:\n k = 0\n for word in movies_words:\n if word in des:\n movie_word_binary[k].append(1.0)\n else:\n movie_word_binary[k].append(0.0)\n k+=1\n \nmovie_word_binary = pd.DataFrame(movie_word_binary).transpose()","execution_count":63,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"tv_word_binary = [[0] * 0 for i in range(len(set(tv_words)))]\n\nfor des in tv_des['description_filtered']:\n k = 0\n for word in tv_words:\n if word in des:\n tv_word_binary[k].append(1.0)\n else:\n tv_word_binary[k].append(0.0)\n k+=1\n \ntv_word_binary = pd.DataFrame(tv_word_binary).transpose()","execution_count":64,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"def recommender2(search):\n cs_list = []\n binary_list = []\n if search in movies_des['title'].values:\n idx = movies_des[movies_des['title'] == search].index.item()\n for i in movie_word_binary.iloc[idx]:\n binary_list.append(i)\n point1 = np.array(binary_list).reshape(1, -1)\n point1 = [val for sublist in point1 for val in sublist] \n for j in range(len(movies_des)):\n binary_list2 = []\n for k in movie_word_binary.iloc[j]:\n binary_list2.append(k)\n point2 = np.array(binary_list2).reshape(1, -1)\n point2 = [val for sublist in point2 for val in sublist]\n dot_product = np.dot(point1, point2)\n norm_1 = np.linalg.norm(point1)\n norm_2 = np.linalg.norm(point2)\n cos_sim = dot_product / (norm_1 * norm_2)\n cs_list.append(cos_sim)\n movies_copy = movies_des.copy()\n movies_copy['cos_sim'] = cs_list\n results = movies_copy.sort_values('cos_sim', ascending=False)\n results = results[results['title'] != search] \n top_results = results.head(5)\n return(top_results)\n elif search in tv_des['title'].values:\n idx = tv_des[tv_des['title'] == search].index.item()\n for i in tv_word_binary.iloc[idx]:\n binary_list.append(i)\n point1 = np.array(binary_list).reshape(1, -1)\n point1 = [val for sublist in point1 for val in sublist]\n for j in range(len(tv)):\n binary_list2 = []\n for k in tv_word_binary.iloc[j]:\n binary_list2.append(k)\n point2 = np.array(binary_list2).reshape(1, -1)\n point2 = [val for sublist in point2 for val in sublist]\n dot_product = np.dot(point1, point2)\n norm_1 = np.linalg.norm(point1)\n norm_2 = np.linalg.norm(point2)\n cos_sim = dot_product / (norm_1 * norm_2)\n cs_list.append(cos_sim)\n tv_copy = tv_des.copy()\n tv_copy['cos_sim'] = cs_list\n results = tv_copy.sort_values('cos_sim', ascending=False)\n results = results[results['title'] != search] \n top_results = results.head(5)\n return(top_results)\n else:\n return(\"Title not in dataset. Please check spelling.\")","execution_count":65,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## 5.1. Recommending Movies"},{"metadata":{"trusted":true},"cell_type":"code","source":"pd.options.display.max_colwidth = 300\nrecommender2('The Conjuring')","execution_count":66,"outputs":[{"output_type":"execute_result","execution_count":66,"data":{"text/plain":" title \\\n1632 Hard Lessons \n3335 Sat Sri Akal \n2549 Mirai \n3910 The Eyes of My Mother \n3578 Standoff \n\n description \\\n1632 This drama based on real-life events tells the story of George McKenna, the tough, determined new principal of a notorious Los Angeles high school. \n3335 Based on true events, this moving story centers on a Punjabi family whose celebration of their faith endures in the face of conflicting attitudes. \n2549 Unhappy after his new baby sister displaces him, four-year-old Kun begins meeting people and pets from his family's history in their unique house. \n3910 At the remote farmhouse where she once witnessed a traumatic childhood event, a young woman develops a grisly fascination with violence. \n3578 After witnessing an assassin's slaughter, a young girl holes up in a farmhouse with a suicidal vet, who must use wits and guts to fend off the killer. \n\n description_filtered \\\n1632 this drama based real-life events tells story george mckenna , tough , determined new principal notorious los angeles high school . \n3335 based true events , moving story centers punjabi family whose celebration faith endures conflicting attitudes . \n2549 unhappy new baby sister displaces , four-year-old kun begins meeting people pets family 's history unique house . \n3910 at remote farmhouse witnessed traumatic childhood event , young woman develops grisly fascination violence . \n3578 after witnessing assassin 's slaughter , young girl holes farmhouse suicidal vet , must use wits guts fend killer . \n\n cos_sim \n1632 0.489419 \n3335 0.478650 \n2549 0.478345 \n3910 0.470605 \n3578 0.460628 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
1632Hard LessonsThis drama based on real-life events tells the story of George McKenna, the tough, determined new principal of a notorious Los Angeles high school.this drama based real-life events tells story george mckenna , tough , determined new principal notorious los angeles high school .0.489419
3335Sat Sri AkalBased on true events, this moving story centers on a Punjabi family whose celebration of their faith endures in the face of conflicting attitudes.based true events , moving story centers punjabi family whose celebration faith endures conflicting attitudes .0.478650
2549MiraiUnhappy after his new baby sister displaces him, four-year-old Kun begins meeting people and pets from his family's history in their unique house.unhappy new baby sister displaces , four-year-old kun begins meeting people pets family 's history unique house .0.478345
3910The Eyes of My MotherAt the remote farmhouse where she once witnessed a traumatic childhood event, a young woman develops a grisly fascination with violence.at remote farmhouse witnessed traumatic childhood event , young woman develops grisly fascination violence .0.470605
3578StandoffAfter witnessing an assassin's slaughter, a young girl holes up in a farmhouse with a suicidal vet, who must use wits and guts to fend off the killer.after witnessing assassin 's slaughter , young girl holes farmhouse suicidal vet , must use wits guts fend killer .0.460628
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2(\"Child's Play\")","execution_count":67,"outputs":[{"output_type":"execute_result","execution_count":67,"data":{"text/plain":" title \\\n2467 Material \n3605 Strange Weather \n3553 Spectral \n1550 Good People \n1017 Dark Places \n\n description \\\n2467 A dutiful son must hide his pursuit of stand-up comedy from his staunch father, who expects him to inherit his store and uphold their Muslim beliefs. \n3605 A grieving mother takes a road trip with her friend to confront the man who, she believes, stole her late son's business idea to get rich. \n3553 When an otherworldly force wreaks havoc on a war-torn European city, an engineer teams up with an elite Special Ops unit to stop it. \n1550 A struggling couple can't believe their luck when they find a stash of money in the apartment of a neighbor who was recently murdered. \n1017 Years after surviving a brutal crime as a child, Libby Day comes to believe that the brother she testified against for committing it may be innocent. \n\n description_filtered \\\n2467 a dutiful must hide pursuit stand-up comedy staunch father , expects inherit store uphold muslim beliefs . \n3605 a grieving mother takes road trip friend confront , believes , stole late 's business idea get rich . \n3553 when otherworldly force wreaks havoc war-torn european city , engineer teams elite special ops unit stop . \n1550 a struggling couple n't believe luck find stash money apartment neighbor recently murdered . \n1017 years surviving brutal crime child , libby day comes believe brother testified committing may innocent . \n\n cos_sim \n2467 0.431291 \n3605 0.420183 \n3553 0.414039 \n1550 0.411766 \n1017 0.410391 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
2467MaterialA dutiful son must hide his pursuit of stand-up comedy from his staunch father, who expects him to inherit his store and uphold their Muslim beliefs.a dutiful must hide pursuit stand-up comedy staunch father , expects inherit store uphold muslim beliefs .0.431291
3605Strange WeatherA grieving mother takes a road trip with her friend to confront the man who, she believes, stole her late son's business idea to get rich.a grieving mother takes road trip friend confront , believes , stole late 's business idea get rich .0.420183
3553SpectralWhen an otherworldly force wreaks havoc on a war-torn European city, an engineer teams up with an elite Special Ops unit to stop it.when otherworldly force wreaks havoc war-torn european city , engineer teams elite special ops unit stop .0.414039
1550Good PeopleA struggling couple can't believe their luck when they find a stash of money in the apartment of a neighbor who was recently murdered.a struggling couple n't believe luck find stash money apartment neighbor recently murdered .0.411766
1017Dark PlacesYears after surviving a brutal crime as a child, Libby Day comes to believe that the brother she testified against for committing it may be innocent.years surviving brutal crime child , libby day comes believe brother testified committing may innocent .0.410391
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Charlie and the Chocolate Factory')","execution_count":68,"outputs":[{"output_type":"execute_result","execution_count":68,"data":{"text/plain":" title \\\n4671 Willy Wonka & the Chocolate Factory \n2040 Kaake Da Viyah \n3796 The Boss's Daughter \n4306 The Wishing Tree \n1884 Inxeba \n\n description \\\n4671 Zany Willy Wonka causes a stir when he announces that golden tickets hidden inside his candy bars will admit holders into his secret confectionary. \n2040 In this zany comedy, a man is torn between the girl he loves and the respective women his warring mother and grandmother have chosen for him to marry. \n3796 While working together, a married textile foreman and his boss’s daughter have a torrid love affair, stirring up hostility among the factory crew. \n4306 Five children living on the edge of a forest band together to save a magical wishing tree from destruction and find their own paths to happiness. \n1884 At an initiation ritual for the young men of his Xhosa community, a closeted factory hand meets a Johannesburg teen who discovers his best-kept secret. \n\n description_filtered \\\n4671 zany willy wonka causes stir announces golden tickets hidden inside candy bars admit holders secret confectionary . \n2040 in zany comedy , torn girl loves respective women warring mother grandmother chosen marry . \n3796 while working together , married textile foreman boss ’ daughter torrid love affair , stirring hostility among factory crew . \n4306 five children living edge forest band together save magical wishing tree destruction find paths happiness . \n1884 at initiation ritual young xhosa community , closeted factory hand meets johannesburg teen discovers best-kept secret . \n\n cos_sim \n4671 0.400892 \n2040 0.383326 \n3796 0.381000 \n4306 0.368856 \n1884 0.363803 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
4671Willy Wonka & the Chocolate FactoryZany Willy Wonka causes a stir when he announces that golden tickets hidden inside his candy bars will admit holders into his secret confectionary.zany willy wonka causes stir announces golden tickets hidden inside candy bars admit holders secret confectionary .0.400892
2040Kaake Da ViyahIn this zany comedy, a man is torn between the girl he loves and the respective women his warring mother and grandmother have chosen for him to marry.in zany comedy , torn girl loves respective women warring mother grandmother chosen marry .0.383326
3796The Boss's DaughterWhile working together, a married textile foreman and his boss’s daughter have a torrid love affair, stirring up hostility among the factory crew.while working together , married textile foreman boss ’ daughter torrid love affair , stirring hostility among factory crew .0.381000
4306The Wishing TreeFive children living on the edge of a forest band together to save a magical wishing tree from destruction and find their own paths to happiness.five children living edge forest band together save magical wishing tree destruction find paths happiness .0.368856
1884InxebaAt an initiation ritual for the young men of his Xhosa community, a closeted factory hand meets a Johannesburg teen who discovers his best-kept secret.at initiation ritual young xhosa community , closeted factory hand meets johannesburg teen discovers best-kept secret .0.363803
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Wild Child')","execution_count":69,"outputs":[{"output_type":"execute_result","execution_count":69,"data":{"text/plain":" title \\\n1319 Fanatyk \n1217 Either Me Or My Auntie \n2694 My Own Man \n2554 Misfit \n1288 Evvarikee Cheppoddu \n\n description \\\n1319 As a son deals with his own struggles, he must calm his father's obsession with fishing before his outlandish behavior ruins the entire family. \n1217 A musician's marriage proposal to his girlfriend is denied by her mother, whose affinity for magic begins to meddle in their relationship even more. \n2694 When a man discovers he will be the father to a boy, his fear and insecurities send him on an emotional, humorous quest for his own manhood. \n2554 After living in America for years, a teenage girl moves back to the Netherlands and is quickly singled out as a misfit by the popular clique at school. \n1288 When caste differences throw a wrench into their otherwise blossoming relationship, a couple must somehow convince the girl’s father to let them marry. \n\n description_filtered \\\n1319 as deals struggles , must calm father 's obsession fishing outlandish behavior ruins entire family . \n1217 a musician 's marriage proposal girlfriend denied mother , whose affinity magic begins meddle relationship even . \n2694 when discovers father boy , fear insecurities send emotional , humorous quest manhood . \n2554 after living america years , teenage girl moves back netherlands quickly singled misfit popular clique school . \n1288 when caste differences throw wrench otherwise blossoming relationship , couple must somehow convince girl ’ father let marry . \n\n cos_sim \n1319 0.497940 \n1217 0.468979 \n2694 0.453565 \n2554 0.448014 \n1288 0.446630 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
1319FanatykAs a son deals with his own struggles, he must calm his father's obsession with fishing before his outlandish behavior ruins the entire family.as deals struggles , must calm father 's obsession fishing outlandish behavior ruins entire family .0.497940
1217Either Me Or My AuntieA musician's marriage proposal to his girlfriend is denied by her mother, whose affinity for magic begins to meddle in their relationship even more.a musician 's marriage proposal girlfriend denied mother , whose affinity magic begins meddle relationship even .0.468979
2694My Own ManWhen a man discovers he will be the father to a boy, his fear and insecurities send him on an emotional, humorous quest for his own manhood.when discovers father boy , fear insecurities send emotional , humorous quest manhood .0.453565
2554MisfitAfter living in America for years, a teenage girl moves back to the Netherlands and is quickly singled out as a misfit by the popular clique at school.after living america years , teenage girl moves back netherlands quickly singled misfit popular clique school .0.448014
1288Evvarikee CheppodduWhen caste differences throw a wrench into their otherwise blossoming relationship, a couple must somehow convince the girl’s father to let them marry.when caste differences throw wrench otherwise blossoming relationship , couple must somehow convince girl ’ father let marry .0.446630
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2(\"Dr. Seuss' The Cat in the Hat\")","execution_count":70,"outputs":[{"output_type":"execute_result","execution_count":70,"data":{"text/plain":" title \\\n1660 He's Out There \n1016 Dark Light \n1853 INDIA \n3808 The Breadwinner \n1217 Either Me Or My Auntie \n\n description \\\n1660 While vacationing at a remote lake house, a mother and her daughters become pawns in the twisted game of an ax-wielding psychopath. \n1016 Implicated in her daughter's disappearance, a mother searches for answers when she returns to an old family home that may have an unwanted visitor. \n1853 A man buys a young girl, code-names her \"Doll\" and sends her to live with a mother of two who has a mysterious mission to be fulfilled. \n3808 A courageous 11-year-old Afghan girl disguises herself as a boy and takes on odd jobs to provide for her family when her father is arrested. \n1217 A musician's marriage proposal to his girlfriend is denied by her mother, whose affinity for magic begins to meddle in their relationship even more. \n\n description_filtered \\\n1660 while vacationing remote lake house , mother daughters become pawns twisted game ax-wielding psychopath . \n1016 implicated daughter 's disappearance , mother searches answers returns old family home may unwanted visitor . \n1853 a buys young girl , code-names `` doll '' sends live mother two mysterious mission fulfilled . \n3808 a courageous 11-year-old afghan girl disguises boy takes odd jobs provide family father arrested . \n1217 a musician 's marriage proposal girlfriend denied mother , whose affinity magic begins meddle relationship even . \n\n cos_sim \n1660 0.486506 \n1016 0.483046 \n1853 0.460195 \n3808 0.454621 \n1217 0.444117 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
1660He's Out ThereWhile vacationing at a remote lake house, a mother and her daughters become pawns in the twisted game of an ax-wielding psychopath.while vacationing remote lake house , mother daughters become pawns twisted game ax-wielding psychopath .0.486506
1016Dark LightImplicated in her daughter's disappearance, a mother searches for answers when she returns to an old family home that may have an unwanted visitor.implicated daughter 's disappearance , mother searches answers returns old family home may unwanted visitor .0.483046
1853INDIAA man buys a young girl, code-names her \"Doll\" and sends her to live with a mother of two who has a mysterious mission to be fulfilled.a buys young girl , code-names `` doll '' sends live mother two mysterious mission fulfilled .0.460195
3808The BreadwinnerA courageous 11-year-old Afghan girl disguises herself as a boy and takes on odd jobs to provide for her family when her father is arrested.a courageous 11-year-old afghan girl disguises boy takes odd jobs provide family father arrested .0.454621
1217Either Me Or My AuntieA musician's marriage proposal to his girlfriend is denied by her mother, whose affinity for magic begins to meddle in their relationship even more.a musician 's marriage proposal girlfriend denied mother , whose affinity magic begins meddle relationship even .0.444117
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Hook')","execution_count":71,"outputs":[{"output_type":"execute_result","execution_count":71,"data":{"text/plain":" title \\\n4371 Tinker Bell and the Legend of the NeverBeast \n2113 Kickboxer: Retaliation \n1740 Hostiles \n1515 Girlfriend's Day \n2804 NOVA: Decoding the Weather Machine \n\n description \\\n4371 When suspicious scout fairies scheme to capture the fearsome-looking NeverBeast, Tinker Bell and Fawn set out to save the wondrous creature. \n2113 Sloan's vow to never return to Thailand is cut short when he's kidnapped and taken to a Thai prison, where he's forced to fight a 400-pound brute. \n1740 After a long career battling the Cheyenne, a U.S. Army captain is ordered to safely escort the tribe's most influential chief to his Montana homeland. \n1515 When he's caught up in a deadly conspiracy, an unemployed greeting card writer must create the perfect card for a new holiday to save his skin. \n2804 Scientists investigate Earth’s climate machine, looking for clues across the globe, from Greenland’s ice sheet to the desert of Australia. \n\n description_filtered \\\n4371 when suspicious scout fairies scheme capture fearsome-looking neverbeast , tinker bell fawn set save wondrous creature . \n2113 sloan 's vow never return thailand cut short 's kidnapped taken thai prison , 's forced fight 400-pound brute . \n1740 after long career battling cheyenne , u.s. army captain ordered safely escort tribe 's influential chief montana homeland . \n1515 when 's caught deadly conspiracy , unemployed greeting card writer must create perfect card new holiday save skin . \n2804 scientists investigate earth ’ climate machine , looking clues across globe , greenland ’ ice sheet desert australia . \n\n cos_sim \n4371 0.425195 \n2113 0.418167 \n1740 0.415629 \n1515 0.415168 \n2804 0.414781 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
4371Tinker Bell and the Legend of the NeverBeastWhen suspicious scout fairies scheme to capture the fearsome-looking NeverBeast, Tinker Bell and Fawn set out to save the wondrous creature.when suspicious scout fairies scheme capture fearsome-looking neverbeast , tinker bell fawn set save wondrous creature .0.425195
2113Kickboxer: RetaliationSloan's vow to never return to Thailand is cut short when he's kidnapped and taken to a Thai prison, where he's forced to fight a 400-pound brute.sloan 's vow never return thailand cut short 's kidnapped taken thai prison , 's forced fight 400-pound brute .0.418167
1740HostilesAfter a long career battling the Cheyenne, a U.S. Army captain is ordered to safely escort the tribe's most influential chief to his Montana homeland.after long career battling cheyenne , u.s. army captain ordered safely escort tribe 's influential chief montana homeland .0.415629
1515Girlfriend's DayWhen he's caught up in a deadly conspiracy, an unemployed greeting card writer must create the perfect card for a new holiday to save his skin.when 's caught deadly conspiracy , unemployed greeting card writer must create perfect card new holiday save skin .0.415168
2804NOVA: Decoding the Weather MachineScientists investigate Earth’s climate machine, looking for clues across the globe, from Greenland’s ice sheet to the desert of Australia.scientists investigate earth ’ climate machine , looking clues across globe , greenland ’ ice sheet desert australia .0.414781
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Holidate')","execution_count":72,"outputs":[{"output_type":"execute_result","execution_count":72,"data":{"text/plain":" title \\\n4707 Yanda Kartavya Aahe \n3165 Red Christmas \n4527 Us and Them \n286 All of You \n3963 The Hateful Eight \n\n description \\\n4707 Thanks to an arranged marriage that was designed to make an ailing grandmother happy, newlyweds Rahul and Swati are virtually strangers. Can a four-day honeymoon make a difference when it comes to the couple's feelings about each other? \n3165 A family Christmas gathering at an isolated Australian estate turns into the holiday from hell after a mysterious stranger turns up at the door. \n4527 Two strangers meet on a train and form a bond that evolves over the years. After a separation, they reconnect and reflect on their love for each other. \n286 Two strangers meet on a dating app and experience instant chemistry, but their relationship unravels as jarring differences catch up to them. \n3963 Years after the Civil War, a bounty hunter and his captive are waylaid by a Wyoming blizzard and hole up in a way station with six dicey strangers. \n\n description_filtered \\\n4707 thanks arranged marriage designed make ailing grandmother happy , newlyweds rahul swati virtually strangers . can four-day honeymoon make difference comes couple 's feelings ? \n3165 a family christmas gathering isolated australian estate turns holiday hell mysterious stranger turns . \n4527 two strangers meet train form bond evolves years . after separation , reconnect reflect love . \n286 two strangers meet dating app experience instant chemistry , relationship unravels jarring differences catch . \n3963 years civil war , bounty hunter captive waylaid wyoming blizzard hole way station six dicey strangers . \n\n cos_sim \n4707 0.449089 \n3165 0.446663 \n4527 0.445435 \n286 0.439155 \n3963 0.439155 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
4707Yanda Kartavya AaheThanks to an arranged marriage that was designed to make an ailing grandmother happy, newlyweds Rahul and Swati are virtually strangers. Can a four-day honeymoon make a difference when it comes to the couple's feelings about each other?thanks arranged marriage designed make ailing grandmother happy , newlyweds rahul swati virtually strangers . can four-day honeymoon make difference comes couple 's feelings ?0.449089
3165Red ChristmasA family Christmas gathering at an isolated Australian estate turns into the holiday from hell after a mysterious stranger turns up at the door.a family christmas gathering isolated australian estate turns holiday hell mysterious stranger turns .0.446663
4527Us and ThemTwo strangers meet on a train and form a bond that evolves over the years. After a separation, they reconnect and reflect on their love for each other.two strangers meet train form bond evolves years . after separation , reconnect reflect love .0.445435
286All of YouTwo strangers meet on a dating app and experience instant chemistry, but their relationship unravels as jarring differences catch up to them.two strangers meet dating app experience instant chemistry , relationship unravels jarring differences catch .0.439155
3963The Hateful EightYears after the Civil War, a bounty hunter and his captive are waylaid by a Wyoming blizzard and hole up in a way station with six dicey strangers.years civil war , bounty hunter captive waylaid wyoming blizzard hole way station six dicey strangers .0.439155
\n
"},"metadata":{}}]},{"metadata":{},"cell_type":"markdown","source":"## 5.2. Recommending TV shows"},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('After Life')","execution_count":73,"outputs":[{"output_type":"execute_result","execution_count":73,"data":{"text/plain":" title \\\n1628 The Paper \n1821 Welcome to the Family \n534 Gentlemen and Gangsters \n1848 Winter Sun \n858 Longmire \n\n description \\\n1628 A construction magnate takes over a struggling newspaper and attempts to wield editorial influence for power and personal gain. \n1821 When an evicted single mom's estranged father dies, she and his second wife cover up his death after learning they've been written out of his will. \n534 Now on the run, a writer relates his previous year's escapades when he got sucked into the thrilling, sordid orbit of boxer and jazz man Henry Morgan. \n1848 Years after ruthless businessmen kill his father and order the death of his twin brother, a modest fisherman adopts a new persona to exact revenge. \n858 This contemporary crime thriller focuses on a Wyoming sheriff who's rebuilding his life and career following the death of his wife. \n\n description_filtered \\\n1628 a construction magnate takes struggling newspaper attempts wield editorial influence power personal gain . \n1821 when evicted single mom 's estranged father , second wife cover death learning 've written . \n534 now run , writer relates previous year 's escapades got sucked thrilling , sordid orbit boxer jazz henry morgan . \n1848 years ruthless businessmen kill father order death twin brother , modest fisherman adopts new persona exact revenge . \n858 this contemporary crime thriller focuses wyoming sheriff 's rebuilding life career following death wife . \n\n cos_sim \n1628 0.483546 \n1821 0.455016 \n534 0.437880 \n1848 0.437384 \n858 0.425307 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
1628The PaperA construction magnate takes over a struggling newspaper and attempts to wield editorial influence for power and personal gain.a construction magnate takes struggling newspaper attempts wield editorial influence power personal gain .0.483546
1821Welcome to the FamilyWhen an evicted single mom's estranged father dies, she and his second wife cover up his death after learning they've been written out of his will.when evicted single mom 's estranged father , second wife cover death learning 've written .0.455016
534Gentlemen and GangstersNow on the run, a writer relates his previous year's escapades when he got sucked into the thrilling, sordid orbit of boxer and jazz man Henry Morgan.now run , writer relates previous year 's escapades got sucked thrilling , sordid orbit boxer jazz henry morgan .0.437880
1848Winter SunYears after ruthless businessmen kill his father and order the death of his twin brother, a modest fisherman adopts a new persona to exact revenge.years ruthless businessmen kill father order death twin brother , modest fisherman adopts new persona exact revenge .0.437384
858LongmireThis contemporary crime thriller focuses on a Wyoming sheriff who's rebuilding his life and career following the death of his wife.this contemporary crime thriller focuses wyoming sheriff 's rebuilding life career following death wife .0.425307
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Anne with an E')","execution_count":74,"outputs":[{"output_type":"execute_result","execution_count":74,"data":{"text/plain":" title \\\n764 Khaani \n348 Dad's Army \n147 Bat Pat \n519 From Dusk Till Dawn \n370 DC's Legends of Tomorrow \n\n description \\\n764 After a rich politician's son kills a young woman's brother, an unlikely romantic connection complicates her pursuit of justice. \n348 This beloved sitcom follows the unlikely heroes of the volunteer British Home Guard as they prepare for German invasion in World War II. \n147 A curious and talkative bat finds spooky fun on the streets of Fogville, a town that's not as quiet as it seems, with a plucky girl and her brothers. \n519 Bank-robbing brothers encounter vengeful lawmen and demons south of the border in this original series based on Robert Rodriguez' cult horror film. \n370 A mysterious \"time master\" from the future unites an unlikely group of superheroes and villains to save the world from a powerful evil. \n\n description_filtered \\\n764 after rich politician 's kills young woman 's brother , unlikely romantic connection complicates pursuit justice . \n348 this beloved sitcom follows unlikely heroes volunteer british home guard prepare german invasion world war ii . \n147 a curious talkative bat finds spooky fun streets fogville , town 's quiet seems , plucky girl brothers . \n519 bank-robbing brothers encounter vengeful lawmen demons south border original series based robert rodriguez ' cult horror film . \n370 a mysterious `` time master '' future unites unlikely group superheroes villains save world powerful evil . \n\n cos_sim \n764 0.410112 \n348 0.405726 \n147 0.397360 \n519 0.392920 \n370 0.389490 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
764KhaaniAfter a rich politician's son kills a young woman's brother, an unlikely romantic connection complicates her pursuit of justice.after rich politician 's kills young woman 's brother , unlikely romantic connection complicates pursuit justice .0.410112
348Dad's ArmyThis beloved sitcom follows the unlikely heroes of the volunteer British Home Guard as they prepare for German invasion in World War II.this beloved sitcom follows unlikely heroes volunteer british home guard prepare german invasion world war ii .0.405726
147Bat PatA curious and talkative bat finds spooky fun on the streets of Fogville, a town that's not as quiet as it seems, with a plucky girl and her brothers.a curious talkative bat finds spooky fun streets fogville , town 's quiet seems , plucky girl brothers .0.397360
519From Dusk Till DawnBank-robbing brothers encounter vengeful lawmen and demons south of the border in this original series based on Robert Rodriguez' cult horror film.bank-robbing brothers encounter vengeful lawmen demons south border original series based robert rodriguez ' cult horror film .0.392920
370DC's Legends of TomorrowA mysterious \"time master\" from the future unites an unlikely group of superheroes and villains to save the world from a powerful evil.a mysterious `` time master '' future unites unlikely group superheroes villains save world powerful evil .0.389490
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Gilmore Girls')","execution_count":75,"outputs":[{"output_type":"execute_result","execution_count":75,"data":{"text/plain":" title \\\n1871 YooHoo to the Rescue \n816 Legacies \n1290 Seis Manos \n1510 The Duchess \n887 Luis Miguel - The Series \n\n description \\\n1871 In a series of magical missions, quick-witted YooHoo and his can-do crew travel the globe to help animals in need. \n816 Born into a rare supernatural bloodline, Hope Mikaelson attends a gifted private school to master her powers and control her innate urges for evil. \n1290 Orphans raised by a martial arts master are plunged into a mystery involving demonic powers, drug cartels, ancient rituals and blood sacrifice. \n1510 Katherine's a single mom juggling her career, her tween daughter, her relationship with her boyfriend — and pondering getting pregnant with her ex. \n887 This series dramatizes the life story of Mexican superstar singer Luis Miguel, who has captivated audiences in Latin America and beyond for decades. \n\n description_filtered \\\n1871 in series magical missions , quick-witted yoohoo can-do crew travel globe help animals need . \n816 born rare supernatural bloodline , hope mikaelson attends gifted private school master powers control innate urges evil . \n1290 orphans raised martial arts master plunged mystery involving demonic powers , cartels , ancient rituals blood sacrifice . \n1510 katherine 's single mom juggling career , tween daughter , relationship boyfriend — pondering getting pregnant ex . \n887 this series dramatizes life story mexican superstar singer luis miguel , captivated audiences latin america beyond decades . \n\n cos_sim \n1871 0.419640 \n816 0.392232 \n1290 0.387836 \n1510 0.376256 \n887 0.376256 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
1871YooHoo to the RescueIn a series of magical missions, quick-witted YooHoo and his can-do crew travel the globe to help animals in need.in series magical missions , quick-witted yoohoo can-do crew travel globe help animals need .0.419640
816LegaciesBorn into a rare supernatural bloodline, Hope Mikaelson attends a gifted private school to master her powers and control her innate urges for evil.born rare supernatural bloodline , hope mikaelson attends gifted private school master powers control innate urges evil .0.392232
1290Seis ManosOrphans raised by a martial arts master are plunged into a mystery involving demonic powers, drug cartels, ancient rituals and blood sacrifice.orphans raised martial arts master plunged mystery involving demonic powers , cartels , ancient rituals blood sacrifice .0.387836
1510The DuchessKatherine's a single mom juggling her career, her tween daughter, her relationship with her boyfriend — and pondering getting pregnant with her ex.katherine 's single mom juggling career , tween daughter , relationship boyfriend — pondering getting pregnant ex .0.376256
887Luis Miguel - The SeriesThis series dramatizes the life story of Mexican superstar singer Luis Miguel, who has captivated audiences in Latin America and beyond for decades.this series dramatizes life story mexican superstar singer luis miguel , captivated audiences latin america beyond decades .0.376256
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Friends')","execution_count":76,"outputs":[{"output_type":"execute_result","execution_count":76,"data":{"text/plain":" title \\\n1700 Thomas and Friends \n211 Bondi Rescue \n593 H \n1266 Saint Seiya: The Lost Canvas \n131 Bad Blood \n\n description \\\n1700 This animated children's series follows the adventures of Thomas, a cheerful blue tank engine who lives on the island of Sodor. \n211 This reality series follows elite professional lifeguards on Sydney's Bondi Beach, as they take on everything from animal stings to criminals. \n593 At a dysfunctional hospital in Paris, three bumbling, eccentric medical employees embark on zany misadventures with surgical imprecision. \n1266 This anime adventure follows the battle between a saint of Athena and an avatar of Hades who's working on a painting that could destroy the world. \n131 This sprawling crime drama follows the true story of the Rizzuto family and its associates, who presided over organized crime in Montreal for decades. \n\n description_filtered \\\n1700 this animated children 's series follows adventures thomas , cheerful blue tank engine lives island sodor . \n211 this reality series follows elite professional lifeguards sydney 's bondi beach , everything animal stings criminals . \n593 at dysfunctional hospital paris , three bumbling , eccentric medical employees embark zany misadventures surgical imprecision . \n1266 this anime adventure follows battle saint athena avatar hades 's working painting could destroy world . \n131 this sprawling crime drama follows true story rizzuto family associates , presided organized crime montreal decades . \n\n cos_sim \n1700 0.419292 \n211 0.403376 \n593 0.403101 \n1266 0.401772 \n131 0.398790 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
1700Thomas and FriendsThis animated children's series follows the adventures of Thomas, a cheerful blue tank engine who lives on the island of Sodor.this animated children 's series follows adventures thomas , cheerful blue tank engine lives island sodor .0.419292
211Bondi RescueThis reality series follows elite professional lifeguards on Sydney's Bondi Beach, as they take on everything from animal stings to criminals.this reality series follows elite professional lifeguards sydney 's bondi beach , everything animal stings criminals .0.403376
593HAt a dysfunctional hospital in Paris, three bumbling, eccentric medical employees embark on zany misadventures with surgical imprecision.at dysfunctional hospital paris , three bumbling , eccentric medical employees embark zany misadventures surgical imprecision .0.403101
1266Saint Seiya: The Lost CanvasThis anime adventure follows the battle between a saint of Athena and an avatar of Hades who's working on a painting that could destroy the world.this anime adventure follows battle saint athena avatar hades 's working painting could destroy world .0.401772
131Bad BloodThis sprawling crime drama follows the true story of the Rizzuto family and its associates, who presided over organized crime in Montreal for decades.this sprawling crime drama follows true story rizzuto family associates , presided organized crime montreal decades .0.398790
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Love on the Spectrum')","execution_count":77,"outputs":[{"output_type":"execute_result","execution_count":77,"data":{"text/plain":" title \\\n1762 Ultramarine Magmell \n1759 Ugly Duckling \n7 100 Humans \n857 London Spy \n426 Durarara!! \n\n description \\\n1762 Decades after the sudden birth of a new continent, a young rescuer-for-hire provides aid to adventurers exploring this dangerous, uncharted world. \n1759 Young women face up to their insecurities and circumstances, finding love and laughs along the way. Featuring a different storyline every season. \n7 One hundred hardy souls from diverse backgrounds participate in playful experiments exploring age, sex, happiness and other aspects of being human. \n857 When his reclusive-banker lover disappears, a hard-partying young British hedonist plunges into the dangerous world of espionage to find the truth. \n426 A young man looking for excitement moves to Ikebukuro, a district in Tokyo, where he finds a world of mystery in which the past and present mesh. \n\n description_filtered \\\n1762 decades sudden birth new continent , young rescuer-for-hire provides aid adventurers exploring dangerous , uncharted world . \n1759 young women insecurities circumstances , finding love laughs along way . featuring different storyline every season . \n7 one hundred hardy souls diverse backgrounds participate playful experiments exploring age , sex , happiness aspects human . \n857 when reclusive-banker lover disappears , hard-partying young british hedonist plunges dangerous world espionage find truth . \n426 a young looking excitement moves ikebukuro , district tokyo , finds world mystery past present mesh . \n\n cos_sim \n1762 0.442339 \n1759 0.437374 \n7 0.433148 \n857 0.423900 \n426 0.416463 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
1762Ultramarine MagmellDecades after the sudden birth of a new continent, a young rescuer-for-hire provides aid to adventurers exploring this dangerous, uncharted world.decades sudden birth new continent , young rescuer-for-hire provides aid adventurers exploring dangerous , uncharted world .0.442339
1759Ugly DucklingYoung women face up to their insecurities and circumstances, finding love and laughs along the way. Featuring a different storyline every season.young women insecurities circumstances , finding love laughs along way . featuring different storyline every season .0.437374
7100 HumansOne hundred hardy souls from diverse backgrounds participate in playful experiments exploring age, sex, happiness and other aspects of being human.one hundred hardy souls diverse backgrounds participate playful experiments exploring age , sex , happiness aspects human .0.433148
857London SpyWhen his reclusive-banker lover disappears, a hard-partying young British hedonist plunges into the dangerous world of espionage to find the truth.when reclusive-banker lover disappears , hard-partying young british hedonist plunges dangerous world espionage find truth .0.423900
426Durarara!!A young man looking for excitement moves to Ikebukuro, a district in Tokyo, where he finds a world of mystery in which the past and present mesh.a young looking excitement moves ikebukuro , district tokyo , finds world mystery past present mesh .0.416463
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('13 Reasons Why')","execution_count":78,"outputs":[{"output_type":"execute_result","execution_count":78,"data":{"text/plain":" title \\\n882 Love, Chunibyo & Other Delusions! \n467 Extracurricular \n126 Baby \n297 CLANNAD \n1095 One Day at a Time \n\n description \\\n882 High schooler Yuta wants to leave his past as a delusional weirdo behind. But his classmate Rikka has her own delusions, and she's interested in his. \n467 A model high school student who's steeped in a world of serious crime finds his double life upended when a classmate takes an interest in his secret. \n126 Fed up with their families and classmates, two teen girls from a wealthy part of Rome are drawn to the city's underworld and start leading double lives. \n297 Maladjusted high school student Tomoya's life begins to change when he befriends his classmate Nagisa and several other eccentric girls. \n1095 In a reimagining of the TV classic, a newly single Latina mother raises her teen daughter and tween son with the \"help\" of her old-school mom. \n\n description_filtered \\\n882 high schooler yuta wants leave past delusional weirdo behind . but classmate rikka delusions , 's interested . \n467 a model high school student 's steeped world serious crime finds double life upended classmate takes interest secret . \n126 fed families classmates , two teen girls wealthy part rome drawn city 's underworld start leading double lives . \n297 maladjusted high school student tomoya 's life begins change befriends classmate nagisa several eccentric girls . \n1095 in reimagining tv classic , newly single latina mother raises teen daughter tween `` help '' old-school mom . \n\n cos_sim \n882 0.472192 \n467 0.424973 \n126 0.424190 \n297 0.406562 \n1095 0.405798 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
882Love, Chunibyo & Other Delusions!High schooler Yuta wants to leave his past as a delusional weirdo behind. But his classmate Rikka has her own delusions, and she's interested in his.high schooler yuta wants leave past delusional weirdo behind . but classmate rikka delusions , 's interested .0.472192
467ExtracurricularA model high school student who's steeped in a world of serious crime finds his double life upended when a classmate takes an interest in his secret.a model high school student 's steeped world serious crime finds double life upended classmate takes interest secret .0.424973
126BabyFed up with their families and classmates, two teen girls from a wealthy part of Rome are drawn to the city's underworld and start leading double lives.fed families classmates , two teen girls wealthy part rome drawn city 's underworld start leading double lives .0.424190
297CLANNADMaladjusted high school student Tomoya's life begins to change when he befriends his classmate Nagisa and several other eccentric girls.maladjusted high school student tomoya 's life begins change befriends classmate nagisa several eccentric girls .0.406562
1095One Day at a TimeIn a reimagining of the TV classic, a newly single Latina mother raises her teen daughter and tween son with the \"help\" of her old-school mom.in reimagining tv classic , newly single latina mother raises teen daughter tween `` help '' old-school mom .0.405798
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Derry Girls')","execution_count":79,"outputs":[{"output_type":"execute_result","execution_count":79,"data":{"text/plain":" title \\\n1258 Rurouni Kenshin \n1631 The Politician \n1867 Yeh Meri Family \n1101 One-Punch Man \n940 Medici: Masters of Florence \n\n description \\\n1258 A nomadic swordsman arrives at a martial arts school in Meiji-era Japan, where he lands in the middle of a conflict involving the opium trade. \n1631 Rich kid Payton has always known he's going to be president. But first he has to navigate the most treacherous political landscape of all: high school. \n1867 In the summer of 1998, middle child Harshu balances school, family, friendship and other challenges of growing up. \n1101 The most powerful superhero in the world can kill anyone with one blow. But nothing can challenge him, so he struggles with ennui and depression. \n940 After his father's murder, banking heir Cosimo Medici battles opponents of his artistic, economic and political visions for 15th-century Florence. \n\n description_filtered \\\n1258 a nomadic swordsman arrives martial arts school meiji-era japan , lands middle conflict involving opium trade . \n1631 rich kid payton always known 's going president . but first navigate treacherous political landscape : high school . \n1867 in summer 1998 , middle child harshu balances school , family , friendship challenges growing . \n1101 the powerful superhero world kill anyone blow . but nothing challenge , struggles ennui depression . \n940 after father 's murder , banking heir cosimo medici battles opponents artistic , economic political visions 15th-century florence . \n\n cos_sim \n1258 0.449171 \n1631 0.437361 \n1867 0.425046 \n1101 0.419330 \n940 0.417407 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
1258Rurouni KenshinA nomadic swordsman arrives at a martial arts school in Meiji-era Japan, where he lands in the middle of a conflict involving the opium trade.a nomadic swordsman arrives martial arts school meiji-era japan , lands middle conflict involving opium trade .0.449171
1631The PoliticianRich kid Payton has always known he's going to be president. But first he has to navigate the most treacherous political landscape of all: high school.rich kid payton always known 's going president . but first navigate treacherous political landscape : high school .0.437361
1867Yeh Meri FamilyIn the summer of 1998, middle child Harshu balances school, family, friendship and other challenges of growing up.in summer 1998 , middle child harshu balances school , family , friendship challenges growing .0.425046
1101One-Punch ManThe most powerful superhero in the world can kill anyone with one blow. But nothing can challenge him, so he struggles with ennui and depression.the powerful superhero world kill anyone blow . but nothing challenge , struggles ennui depression .0.419330
940Medici: Masters of FlorenceAfter his father's murder, banking heir Cosimo Medici battles opponents of his artistic, economic and political visions for 15th-century Florence.after father 's murder , banking heir cosimo medici battles opponents artistic , economic political visions 15th-century florence .0.417407
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Breaking Bad')","execution_count":80,"outputs":[{"output_type":"execute_result","execution_count":80,"data":{"text/plain":" title \\\n996 Mr. Iglesias \n931 Marvel's The Punisher \n1297 Servant of the People \n443 El Reemplazante \n132 Bad Education \n\n description \\\n996 Hilarious high school teacher Gabriel Iglesias tries to make a difference in the lives of some smart but underperforming students at his alma mater. \n931 A former Marine out to punish the criminals responsible for his family's murder finds himself ensnared in a military conspiracy. \n1297 After a Ukrainian high school teacher's tirade against government corruption goes viral on social media, he finds himself the country's new president. \n443 A former high-ranking financial executive finds redemption and romance when he's paroled after a prison sentence and becomes a math teacher. \n132 A history teacher at the posh Abbey Grove, Alfie Wickers is something truly special: He's his school's, if not England's, single worst educator. \n\n description_filtered \\\n996 hilarious high school teacher gabriel iglesias tries make difference lives smart underperforming students alma mater . \n931 a former marine punish criminals responsible family 's murder finds ensnared military conspiracy . \n1297 after ukrainian high school teacher 's tirade government corruption goes viral social media , finds country 's new president . \n443 a former high-ranking financial executive finds redemption romance 's paroled prison sentence becomes math teacher . \n132 a history teacher posh abbey grove , alfie wickers something truly special : he 's school 's , england 's , single worst educator . \n\n cos_sim \n996 0.467099 \n931 0.456435 \n1297 0.453632 \n443 0.443622 \n132 0.412479 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
996Mr. IglesiasHilarious high school teacher Gabriel Iglesias tries to make a difference in the lives of some smart but underperforming students at his alma mater.hilarious high school teacher gabriel iglesias tries make difference lives smart underperforming students alma mater .0.467099
931Marvel's The PunisherA former Marine out to punish the criminals responsible for his family's murder finds himself ensnared in a military conspiracy.a former marine punish criminals responsible family 's murder finds ensnared military conspiracy .0.456435
1297Servant of the PeopleAfter a Ukrainian high school teacher's tirade against government corruption goes viral on social media, he finds himself the country's new president.after ukrainian high school teacher 's tirade government corruption goes viral social media , finds country 's new president .0.453632
443El ReemplazanteA former high-ranking financial executive finds redemption and romance when he's paroled after a prison sentence and becomes a math teacher.a former high-ranking financial executive finds redemption romance 's paroled prison sentence becomes math teacher .0.443622
132Bad EducationA history teacher at the posh Abbey Grove, Alfie Wickers is something truly special: He's his school's, if not England's, single worst educator.a history teacher posh abbey grove , alfie wickers something truly special : he 's school 's , england 's , single worst educator .0.412479
\n
"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"recommender2('Stranger Things')","execution_count":81,"outputs":[{"output_type":"execute_result","execution_count":81,"data":{"text/plain":" title \\\n727 Jamtara - Sabka Number Ayega \n186 Bitter Daisies \n1121 Paradise PD \n1267 Sakho & Mangane \n1650 The Search \n\n description \\\n727 A group of small-town young men run a lucrative phishing operation, until a corrupt politician wants in on their scheme – and a cop wants to fight it. \n186 While investigating the disappearance of a teen girl in a tight-knit Galician town, a Civil Guard officer uncovers secrets linked to a loss of her own. \n1121 An eager young rookie joins the ragtag small-town police force led by his dad as they bumble, squabble and snort their way through a big drug case. \n1267 A by-the-book police captain and a brash young detective must team up to take on the supernatural when strange forces begin to wreak havoc on Dakar. \n1650 When a girl vanishes from a suburb near Mexico City, the personal goals of some involved in the case muddy the search. Based on a true story. \n\n description_filtered \\\n727 a group small-town young run lucrative phishing operation , corrupt politician wants scheme – cop wants fight . \n186 while investigating disappearance teen girl tight-knit galician town , civil guard officer uncovers secrets linked loss . \n1121 an eager young rookie joins ragtag small-town police force led dad bumble , squabble snort way big case . \n1267 a by-the-book police captain brash young detective must team supernatural strange forces begin wreak havoc dakar . \n1650 when girl vanishes suburb near mexico city , personal goals involved case muddy search . based true story . \n\n cos_sim \n727 0.469790 \n186 0.455468 \n1121 0.443310 \n1267 0.435665 \n1650 0.428929 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
titledescriptiondescription_filteredcos_sim
727Jamtara - Sabka Number AyegaA group of small-town young men run a lucrative phishing operation, until a corrupt politician wants in on their scheme – and a cop wants to fight it.a group small-town young run lucrative phishing operation , corrupt politician wants scheme – cop wants fight .0.469790
186Bitter DaisiesWhile investigating the disappearance of a teen girl in a tight-knit Galician town, a Civil Guard officer uncovers secrets linked to a loss of her own.while investigating disappearance teen girl tight-knit galician town , civil guard officer uncovers secrets linked loss .0.455468
1121Paradise PDAn eager young rookie joins the ragtag small-town police force led by his dad as they bumble, squabble and snort their way through a big drug case.an eager young rookie joins ragtag small-town police force led dad bumble , squabble snort way big case .0.443310
1267Sakho & ManganeA by-the-book police captain and a brash young detective must team up to take on the supernatural when strange forces begin to wreak havoc on Dakar.a by-the-book police captain brash young detective must team supernatural strange forces begin wreak havoc dakar .0.435665
1650The SearchWhen a girl vanishes from a suburb near Mexico City, the personal goals of some involved in the case muddy the search. Based on a true story.when girl vanishes suburb near mexico city , personal goals involved case muddy search . based true story .0.428929
\n
"},"metadata":{}}]},{"metadata":{},"cell_type":"markdown","source":"# 6. Conclusion\n\nTaking the cast, director, country, rating and genres as features rather than the descriptions was definitely the better option. Some of the recommendations by descriptions are good such as the 'Tinker Bell and the Legend of the NeverBeast' recommendation for 'Hook' and the 'Extracurricular' recommendation for '13 Reasons Why', but most of them are from completely different genres with very little in common besides a few key words."}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.7.9","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":4}