This project helps a user find restaurants in a City. The bigger the size of circle more the number of restaurants present at that location.
This project uses K-means clustering to cluster a group of amenities and find their centroid.
Steps:
- Data Collection: Collected data from Kaggle.
- Data Cleaning: Removal of Null and unnecessary values.
- Data Visualisation: Visualised cleaned data for a better understanding of the dataset.
- Run K-Means clustering: Employed elbow method to find the optimal value of K which represents the number of clusters present in the dataset.
- Fetching Geolocational Data: Firstly, initialized GeoPy, a library to fetch the coordinates of a city, later the coordinates were passed to FourSquare API which lists the venues present in that particular city. The data received is in JSON format, which is converted into a data frame for further processing.
- Presenting findings on a Map: Using the Folium library, the acquired data were plotted on a map. Each represented an area(with address) where the number of restaurants was more.
Libraries used:
- Numpy
- Pandas
- scikit-learn
- Tkinter
- GeoPy
- Folium
- Seaborn
- Webview
How to run this project?
- Open this folder in Visual Studio Code.
- Open the project.py file.
- Ensure you have VS Code extension Live Server(by Ritwick Dey) installed.
- Click on Go Live present on the bottom right of your VSC window. This opens an instance of your browser, we don't need that so close!
- Run the project.py file.
- Select any city from the list of cities available.
- Click on, Go.
- This opens the map of the city you've selected and restaurants are plotted on that map.
What if want to add a new city?
- Go to the exploratory_data_analysis_on_geolocational_data.py file.
- On line 52 you'll see a variable named city, enter the city name.
- Now go to line 296, there on the map_.save("Cities/Chandigarh.html"), and change the city name according to your needs.
- Run the .py file.
- The city's map will get stored in the Cities folder.
- Now open the project.py file.
- Add your city name in the cities tuple(recommended to name the city the same as the saved map file name).
- Run the project.py file.