TripGo DALV
A project to recommend places to visit in Bangalore city based on user's preference.
Table of contents
Did you ever get confused while choosing a destination for a crazy outing with your squad? There might be a situation when someone wants to go shopping, some like natural places and what about the spiritual peeps. Finding it challenging to select a location that fulfils each and every one's preference. I was facing the same problem, so thought of solving this problem using python.
Problem
How to find a location for a casual outing with your group, in Bangalore City.
Approach
This is a kind of simple recommendation system, where based on preference, it will recommend places. Here we have different preferences like Nature, Adventure, Fun & Thrill, Shopping and Cultural We started by collecting data from the web and manually rating each place based on these preferences out of 5. Here's an example below -
We collected the data of around 60 top places within Bangalore city.
On the frontend form, we are collecting values of these 5 parameters through a frontend form developed in basic HTML/CSS
Tech Solution
The frontend form was connected with python using Flask Framework. The data received from the form was converted into a list.
nature = int(request.form['nature'])
adventure = int(request.form['adventure'])
fun = int(request.form['fun'])
shopping = int(request.form['shopping'])
cultural = int(request.form['cultural'])
userPref = [nature, adventure, fun, shopping, cultural]
Now we are creating a nested list of travel places
df = pd.read_csv('URL_OF_OUR SHEET')
travelplaces = []
for i in df.index:
rows = [df['place'][i], df['nature'][i],df['adventure'][i], df['funAndThrill'][i], df['shopping'][i], df['cultural'][i],
df['budget'][i], df['Distance'][i], df['ratings'][i]]
travelplaces.append(rows)
Now finding the vector distance for each place and finding vector distance using np.linalg.norm
for each place and storing into a dictionary.
for i in travelplaces:
user = np.array(userInput)
dbData = np.array(i[1:8])
dis = np.linalg.norm(user - dbData)
placedict[i[0]] = dis
sorted_dict = {}
sorted_keys = sorted(placedict, key=placedict.get)
Finally sorting the dictionary in ascending order of vector distance and finding the top three recommendations. Displaying the same to user. This system also sends an email to the user, in case they want to save for future reference. Here's the complete code : %[github.com/laksh-2193/TripgoDalv]
Cheers to my team Aryan Bakle, Diya hafiz and Vishwa Shah for their effort.
Thanks to our mentor Saurabh Mahajan from Atria University for his guidance throughout the project.
Do let me know in comments for the scope of further improvements.