codeheroku / Introduction-to-Machine-Learning

This repo will house all our course material and code snippets from the Introduction to Machine Learning Class
MIT License
427 stars 916 forks source link

Strick title name #5

Open shnkreddy98 opened 4 years ago

shnkreddy98 commented 4 years ago

I was checking out the movie recommendation code and found out that if the movie_user_likes should match the exact title of the movie or else it gives the following error.. Ok the movie title being strict is alright but it is also case sensitive... for example if i give "the avengers" it will still give the following error. Traceback (most recent call last): File "d:/Documents/8sem/Project Phase II/contentbased.py", line 47, in movie_index = get_index_from_title(movie_user_likes) File "d:/Documents/8sem/Project Phase II/contentbased.py", line 10, in get_index_from_title return df[df.title == title]["index"].values[0] IndexError: index 0 is out of bounds for axis 0 with size 0

so i tried turning the user data into camel case but then again it will show the same error cause the preposition in the title are small case.. I'm pretty much stuck here... I would be thankful to someone who can show me a way around it.. I'm open for new ideas... PLEASE HELP

jayesh1147 commented 4 years ago

I was checking out the movie recommendation code and found out that if the movie_user_likes should match the exact title of the movie or else it gives the following error.. Ok the movie title being strict is alright but it is also case sensitive... for example if i give "the avengers" it will still give the following error. Traceback (most recent call last): File "d:/Documents/8sem/Project Phase II/contentbased.py", line 47, in movie_index = get_index_from_title(movie_user_likes) File "d:/Documents/8sem/Project Phase II/contentbased.py", line 10, in get_index_from_title return df[df.title == title]["index"].values[0] IndexError: index 0 is out of bounds for axis 0 with size 0

so i tried turning the user data into camel case but then again it will show the same error cause the preposition in the title are small case.. I'm pretty much stuck here... I would be thankful to someone who can show me a way around it.. I'm open for new ideas... PLEASE HELP

So you can do one thing concert every movie name in the dataset tolower and in function also convert the input to all lower letter.That way user input would not be case sensitive