Skip to content

submission-SpatialSage #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 221 additions & 0 deletions EDA Recomendation system.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Recommendation 1: Sydney - Score: 0\n",
"Recommendation 2: ibis Sydney Darling Harbour - Score: 0\n",
"Recommendation 3: Novotel Sydney on Darling Harbour - Score: 0\n",
"Recommendation 4: Oaks Goldsbrough Apartments - Score: 0\n",
"Recommendation 5: The Little Snail Restaurant - Score: 0\n"
]
}
],
"source": [
"import json\n",
"\n",
"# Load data from the JSON file\n",
"with open('sydney.json') as f:\n",
" data = json.load(f)\n",
"\n",
"# Extract the relevant information for analysis\n",
"results = data['results']\n",
"for result in results:\n",
" name = result['name']\n",
" location = result['geometry']['location']\n",
" latitude = location['lat']\n",
" longitude = location['lng']\n",
" # You can extract and process more information as needed for recommendation\n",
"\n",
"# Implement a scoring mechanism based on specific criteria\n",
"# Define weights for different parameters and calculate a score for each location\n",
"\n",
"# Example scoring function\n",
"def calculate_score(latitude, longitude):\n",
" # Define your scoring logic here\n",
" score = 0\n",
" # Add or subtract points based on specific parameters\n",
" # Consider factors such as population density, income levels, competitor proximity, etc.\n",
" return score\n",
"\n",
"# Iterate through the locations and calculate scores\n",
"scores = []\n",
"for result in results:\n",
" latitude = result['geometry']['location']['lat']\n",
" longitude = result['geometry']['location']['lng']\n",
" score = calculate_score(latitude, longitude)\n",
" scores.append((result, score))\n",
"\n",
"# Sort locations based on scores\n",
"sorted_scores = sorted(scores, key=lambda x: x[1], reverse=True)\n",
"\n",
"# Print the top recommendations\n",
"num_recommendations = 5 # Number of recommendations to display\n",
"for i in range(num_recommendations):\n",
" print(f\"Recommendation {i + 1}: {sorted_scores[i][0]['name']} - Score: {sorted_scores[i][1]}\")\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-29T10:11:35.245875400Z",
"start_time": "2023-10-29T10:11:35.173413600Z"
}
},
"id": "8e740d9ea8cd3a8b"
},
{
"cell_type": "code",
"execution_count": 3,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting folium\n",
" Downloading folium-0.14.0-py2.py3-none-any.whl (102 kB)\n",
"Requirement already satisfied: jinja2>=2.9 in c:\\users\\vedant\\anaconda3\\lib\\site-packages (from folium) (3.1.2)\n",
"Requirement already satisfied: numpy in c:\\users\\vedant\\anaconda3\\lib\\site-packages (from folium) (1.23.5)\n",
"Collecting branca>=0.6.0\n",
" Downloading branca-0.6.0-py3-none-any.whl (24 kB)\n",
"Requirement already satisfied: requests in c:\\users\\vedant\\anaconda3\\lib\\site-packages (from folium) (2.27.1)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in c:\\users\\vedant\\anaconda3\\lib\\site-packages (from jinja2>=2.9->folium) (2.0.1)\n",
"Requirement already satisfied: idna<4,>=2.5 in c:\\users\\vedant\\anaconda3\\lib\\site-packages (from requests->folium) (3.3)\n",
"Requirement already satisfied: charset-normalizer~=2.0.0 in c:\\users\\vedant\\anaconda3\\lib\\site-packages (from requests->folium) (2.0.4)\n",
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\\users\\vedant\\anaconda3\\lib\\site-packages (from requests->folium) (1.26.17)\n",
"Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\vedant\\anaconda3\\lib\\site-packages (from requests->folium) (2021.10.8)\n",
"Installing collected packages: branca, folium\n",
"Successfully installed branca-0.6.0 folium-0.14.0\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING: Ignoring invalid distribution -orch (c:\\users\\vedant\\anaconda3\\lib\\site-packages)\n",
"WARNING: Ignoring invalid distribution -orch (c:\\users\\vedant\\anaconda3\\lib\\site-packages)\n",
"WARNING: Ignoring invalid distribution -orch (c:\\users\\vedant\\anaconda3\\lib\\site-packages)\n",
"WARNING: Ignoring invalid distribution -orch (c:\\users\\vedant\\anaconda3\\lib\\site-packages)\n",
"WARNING: Ignoring invalid distribution -orch (c:\\users\\vedant\\anaconda3\\lib\\site-packages)\n",
"WARNING: Ignoring invalid distribution -orch (c:\\users\\vedant\\anaconda3\\lib\\site-packages)\n",
"WARNING: Ignoring invalid distribution -orch (c:\\users\\vedant\\anaconda3\\lib\\site-packages)\n",
"WARNING: Ignoring invalid distribution -orch (c:\\users\\vedant\\anaconda3\\lib\\site-packages)\n"
]
}
],
"source": [
"!pip install folium"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-29T10:12:49.227890400Z",
"start_time": "2023-10-29T10:12:43.169190900Z"
}
},
"id": "235bc7c50c4b1409"
},
{
"cell_type": "code",
"execution_count": 6,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Top Recommendation: Adina Apartment Hotel Sydney Darling Harbour\n"
]
},
{
"data": {
"text/plain": "True"
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import json\n",
"import folium\n",
"from folium.plugins import HeatMap\n",
"\n",
"# Load data from the JSON file\n",
"with open('sydney.json') as f:\n",
" data = json.load(f)\n",
"\n",
"# Extract the relevant location data\n",
"locations = []\n",
"for result in data['results']:\n",
" location = result['geometry']['location']\n",
" name = result['name']\n",
" score = len(name) # Example scoring based on the length of the name\n",
" locations.append([location['lat'], location['lng'], score])\n",
"\n",
"# Create a base map\n",
"m = folium.Map(location=[-33.8688197, 151.2092955], zoom_start=12)\n",
"\n",
"# Create a heatmap layer\n",
"HeatMap(locations).add_to(m)\n",
"\n",
"# Save the map to an HTML file\n",
"m.save('heatmap.html')\n",
"\n",
"# Recommendation logic\n",
"# Sort locations based on the score\n",
"sorted_locations = sorted(locations, key=lambda x: x[2], reverse=True)\n",
"\n",
"# Display the top recommendation\n",
"top_recommendation = sorted_locations[0]\n",
"print(f\"Top Recommendation: {data['results'][locations.index(top_recommendation)]['name']}\")\n",
"\n",
"# Open the generated heatmap in a web browser\n",
"import webbrowser\n",
"webbrowser.open('heatmap.html')\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-29T10:17:58.221049600Z",
"start_time": "2023-10-29T10:17:57.905657300Z"
}
},
"id": "f5863d524b3f7bbd"
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false
},
"id": "980ad5fe495f8a23"
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# Code-with-Google-Maps-2023 - Hack2skill
#### Team Name - Spatial Sage
#### Problem Statement - Geospatial Analytics and Business Intelligence
#### Team Leader Email - [email protected]

Welcome to the official repository for the Code-with-Google-Maps-2023 organized by Hack2skill!

## Getting Started

To get started with the Code-with-Google-Maps-2023 repository, follow these steps:

### Submission Instruction:
1. Fork this repository
2. Create a folder with your Team Name
3. Upload all the code and necessary files in the created folder
4. Upload a **README.md** file in your folder with the below mentioned informations.
5. Generate a Pull Request with your Team Name. (Example: submission-XYZ_team)
### A Brief of the Prototype:
SpatialSage is our advanced tool that uses Google Maps to show where customers are most active. It helps businesses decide where to open stores and plan their marketing. By using real-time data from Google Maps, businesses get up-to-date insights to make informed decisions. SpatialSage is a user-friendly and intuitive tool that doesn't require advanced technical knowledge. Businesses of all sizes can easily integrate it into their decision-making processes. By leveraging real-time data from Google Maps, SpatialSage ensures that the information businesses rely on is always up-to-date and accurate. The tool provides actionable insights that help organizations optimize their operations and increase their chances of success. It offers a user-friendly platform for making informed decisions related to store openings, marketing strategies, and customer engagement. By visualizing customer activity and traffic patterns, Spatial Sage empowers businesses to thrive in an ever-changing marketplace. GOOGLE APIs: Maps JavaScript API: Embeds interactive Google Maps on the web tool, visualizing customer activity heatmaps and overlaying business data for user interaction and analysis. Places API: Retrieves surrounding places (e.g., cafes, competitors) near potential store locations, offering a comprehensive view of the local business landscape.

### README.md must consist of the following information:
BUSINESS LOGIC: Data Collection: Fetching real-time Google Maps data and integrate with business metrics for timely insights. Data Integration: Validate and merge datasets, converting addresses to coordinates with the Geocoding API. Analysis & Modeling: Use algorithms to identify high-activity areas, assess competitors, and predict business potential. Visualization & Interaction: Overlay insights on an interactive map using the Maps JavaScript API. Recommendation Generation: Rank potential locations based on activity, competition, and accessibility, providing actionable marketing strategies. Feedback & Refinement: Iteratively improve the tool based on user feedback and market changes. Deployment & Monitoring: Launch on a web platform, monitor performance, and optimize API usage.

#### Team Name -
#### Problem Statement -
#### Team Leader Email -
![image](https://github.com/shubhambhardwaj7558/Spatial_Sage/assets/149321590/60918d3d-02f4-40b7-8c41-9d6b195012b2)

### A Brief of the Prototype:
This section must include UML Diagrams and prototype description

### Tech Stack:
List Down all technologies used to Build the prototype
HTML, CSS, Javascript, Python, Google Maps Places & Javascript API

### Step-by-Step Code Execution Instructions:
This Section must contain a set of instructions required to clone and run the prototype so that it can be tested and deeply analyzed

Clone the Repository:

Open your terminal or command prompt.
Run the following command to clone the repository to your local machine:
git clone https://github.com/shubhambhardwaj7558/Spatial_Sage.git

Navigate to the Project Directory:
Change your current directory to the project's root folder:
cd repository-name

Install Dependencies:
Check if your project has any dependencies, and if so, make sure to install them. You can typically find dependency information in a package.json file.

Run the Prototype

### Future Scope:
Write about the scalability and futuristic aspects of the prototype developed
This prototype's future scope revolves around scalability and adaptability to handle growing data volumes, offering multi-platform support, integrating third-party services, and embracing advanced technologies like AI. It envisions enhancing user experiences, expanding globally, and promoting data-driven decision-making. Simultaneously, this prototype holds the potential to transform industries through innovative location-based services, personalized interactions, and the sustainability to meet evolving business and consumer needs. It promises to revolutionize how businesses utilize geographical data, positioning itself as a pivotal player in location-based technology's ever-evolving landscape. We will use Geocoding API that converts business addresses to map coordinates for accurate visualization, and vice-versa, ensuring seamless integration of business data on maps, Distance Matrix API which will help in accessibility of potential store locations by providing travel times/distances from key points, aiding in location evaluation and Geolocation API allpwing us to pinpoints users' current location, allowing field agents or businesses to access real-time insights about specific regions they're in.

Binary file added bg_image.avif
Binary file not shown.
Binary file added bg_image_1.avif
Binary file not shown.
Binary file added bg_image_2.avif
Binary file not shown.
Binary file added bg_image_3.avif
Binary file not shown.
Binary file added bg_image_4.avif
Binary file not shown.
Binary file added bg_image_5.avif
Binary file not shown.
Loading