<jupyter_start><jupyter_text>Applied Data Science Capstone  Introduction In my scenario, I am interested in finding an ideal neighborhood for a late-night French Fry Boutique. Even in Atlanta, there are few late night food options and there is potential for demand. This hypothetical french fry boutique would feature items ranging from about $5-15 and we will focus on snack and comfort food rather than entrees, for the sake of defining our business. To guide enquiry, we will lead with a few hypotheses and verify them as best as we can with available data. Positive Influencers* Proximity to younger areas, high schools, and colleges* Affluent area* Local bars and late-night attractions* Lots of pedestrians    * Area should be known as generally safe    * Pedestrians new to the store may be more willing to stop in and grab a snack       Negative Influencers  * Fast Food    * May lose potential new customers if they compare our fries 'with the works' to a chain's $0.99 box of fries  Data We will be using several datasets to evaluate our hypotheses above and answer our ultimate question.* NPU json to map the statistical regions (NPU.json)* Data concerning various statistics about the neighborhoods (NPU_DATA.csv)* Data gathered from Foursquare (venues.csv)    * Discover information about potential competitors to confirm, deny, or modify our hypotheses    * Determine companion shops via clustering to generate viable neighborhoods* [Crime data](http://www.atlantapd.org/i-want-to/crime-data-downloads) to evaluate safety (COBRA-2019.csv)<jupyter_code>import pandas as pd
import os
npu = os.path.join('Data', 'NPU_DATA.csv')
crime = os.path.join('Data', 'COBRA-2019.csv')
venues = os.path.join('Data', 'venues.csv')

venues_df = pd.read_csv(venues)
venues_df = venues_df.drop('Unnamed: 0', 1)
npu_df = pd.read_csv(npu)
npu_df = npu_df.drop('Unnamed: 0', 1)
crime_df = pd.read_csv(crime)
npu_df.info()
venues_df.info()
crime_df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 6349 entries, 0 to 6348
Data columns (total 19 columns):
Report Number              6349 non-null int64
Report Date                6349 non-null object
Occur Date                 6349 non-null object
Occur Time                 6349 non-null object
Possible Date              6349 non-null object
Possible Time              6349 non-null int64
Beat                       6343 non-null float64
Apartment Office Prefix    164 non-null object
Apartment Number           1119 non-null object
Location                   6349 non-null object
Shift Occurrence           6349 non-null object
Location Type              5916 non-null object
UCR Literal                6349 non-null object
UCR #                      6349 non-null int64
IBR Code                   6349 non-null object
Neighborhood               6115 non-null object
NPU                        6346 non-null object
Latitude                   6349 non-null float64
Longitude                  6349[...]<jupyter_text>I've overlaid the crime data onto the statistical regions.<jupyter_code>import IPython
crime_map = os.path.join('Figures', 'atl_crime_map.html')
IPython.display.IFrame(crime_map, 1000, 1000)<jupyter_output><empty_output><jupyter_text>Methodology  Safety We evaluated a neighborhood's safety by counting the number of violent crimes in a region. Because we are interested in the perceived danger of a region, the total number of violent crimes is more relevant than the per capita representation. We then had to broadcast the number of crimes down to the individual neighborhoods, which subdivide the neighborhood planning units.  Attractions We were able to determine the attractions for each neighborhood by first using Google Maps API to determine the representative coordinates for each neighborhood. We then used the representative point to find all attractions within a certain radius (1 km). We determined compatible attractions and used those to define a classification of whether an area was a good candidate for our restaurant.  Analysis We scaled the data so it could be used by our machine learning algorithms. We began by trying a similar procedure as the Toronto neighborhoods project. Unfortunately, we were unable to generate good clusters when looked at with silhouette analysis. The solution was to refine the question to a classification problem rather than clustering. The similar venue categories were determined to be: 'Gastropub', 'Burger Joint', 'Candy Store', 'Dive Bar', 'Fish & Chips Shop', 'Fried Chicken Joint'. Notable exceptions are various cultural and fast food categories. By training a K-Nearest Neighbors model on the combined Neighborhoods and venues datasets, we could filter most of the neighborhoods. Finally, we gathered the result by assigning importance to low age, low crime, and high income. We used binning to smooth over minute differences before doing a multicolumn sort to determine the most compatible neighborhoods.  Results<jupyter_code>resultpath = os.path.join('Data', 'Result.csv')
result = pd.read_csv(resultpath)
result = result.drop('Unnamed: 0', 1)
result['Name'].iloc[:5]
result_map = os.path.join('Figures', 'ResultMap.html')
IPython.display.IFrame(result_map, 750, 750)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.058565433040824115, 'fraction_numerical': 0.02518122853872568, 'mean_word_length': 3.8367158671586714, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '227294', 'license': 'MIT', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1306, 'n_words': 647, 'path': 'Capstone_Report.ipynb', 'repo_name': 'Fradley/Atlanta-Neighborhoods', 'size': '5242'}