Problem: Multiple clicks are required to list Starbucks Coffee store amenities

Goal: Visualize the Starbucks Coffee Store locations and their amenities

Scope:

  • Scrapy for web scraping stores and their amenities via Starbucks Coffee Store Locator website
  • R for numerical / visual EDA
  • CARTO for visual EDA
  • MCA (Multiple Correspondence Analysis) for analyzing commonalities between the amenities
  • Map layer for Shiny Citibike Analysis app

The Process:

Scrapy the magic sauce:

Processed data provides store geospatial information and associated amenities

  • Regex (regular expressions) for feature engineering amenities data - used as filter criteria in CARTO map layers
  • HTML wrapper for store location - CARTO renders fields in HTML format out of the box
  • Duplicate rows!! Not an issue for CARTO which treats geospatial locations as unique

View of the CARTO ready data after processing in Scrapy and R is complete:

List of Amenities:

Five most common amenities:

  • LB: LaBoulange
  • WA: Oven-warmed Food
  • LU: Lunch
  • DR: Digital Rewards
  • XO: Mobile Order and Pay

Five least common amenities:

  • DT: Drive-Through
  • EM: Starbucks Evenings
  • WT: tbd - Walk-T
  • FZ: Fizzio Handcrafted Sodas
  • hrs24: Open 24 hours per day

MCA (Multiple Correspondence Analysis)

As with PCA and Correspondence Analysis, MCA allows us to analyze the systematic patterns of variations with categorical data.

List the eigen values

##         eigenvalue percentage of variance
## dim 1  0.229307542             22.9307542
## dim 2  0.108699691             10.8699691
## dim 3  0.077774909              7.7774909
## dim 4  0.067799432              6.7799432
## dim 5  0.057700086              5.7700086
## dim 6  0.052447829              5.2447829
## dim 7  0.050270614              5.0270614
## dim 8  0.047859791              4.7859791
## dim 9  0.044506750              4.4506750
## dim 10 0.043505613              4.3505613
## dim 11 0.037468709              3.7468709
## dim 12 0.034816182              3.4816182
## dim 13 0.031310764              3.1310764
## dim 14 0.025410279              2.5410279
## dim 15 0.022428156              2.2428156
## dim 16 0.020807183              2.0807183
## dim 17 0.016384901              1.6384901
## dim 18 0.011369265              1.1369265
## dim 19 0.007996684              0.7996684
## dim 20 0.005336062              0.5336062
## dim 21 0.004379128              0.4379128
## dim 22 0.002420429              0.2420429
##        cumulative percentage of variance
## dim 1                           22.93075
## dim 2                           33.80072
## dim 3                           41.57821
## dim 4                           48.35816
## dim 5                           54.12817
## dim 6                           59.37295
## dim 7                           64.40001
## dim 8                           69.18599
## dim 9                           73.63666
## dim 10                          77.98723
## dim 11                          81.73410
## dim 12                          85.21571
## dim 13                          88.34679
## dim 14                          90.88782
## dim 15                          93.13063
## dim 16                          95.21135
## dim 17                          96.84984
## dim 18                          97.98677
## dim 19                          98.78644
## dim 20                          99.32004
## dim 21                          99.75796
## dim 22                         100.00000

View the relationships

Five most common amenities:

  • LB: LaBoulange
  • WA: Oven-warmed Food
  • LU: Lunch
  • DR: Digital Rewards
  • XO: Mobile Order and Pay
MCA results shows amenities CD (Mobile Payment) and MX (Music Experience) within the cluster having the five most common amenities.

Five least common amenities:

  • DT: Drive-Through
  • EM: Starbucks Evenings
  • WT: tbd - Walk-T
  • FZ: Fizzio Handcrafted Sodas
  • hrs24: Open 24 hours per day

Follow ups:

  1. Highlight the Most / Least common amenities when the user hovers over a store location in CARTO
  2. Create a Map Layer for Shiny Citibike Analysis app, allowing users to locate Starbucks Coffee stores based on amenities and proximity

LinkedIn: Jhonasttan Regalado