Sweetwater.com is a site that caters to musicians, producers, performers, and studio engineers, offering a huge catalogue of music-related products for both production and performance. My approach to this assignment was as follows:
Sweetwater’s page includes three tabs of recommended products:
This code reads in some text files that I scraped from my purchase history and from the sweetwater.com web site, both for my own account (with an order history) and for a fresh account I just created.
# Read tsv of purchases
purch <- read.delim("sweetwater_purchases.txt", header = F)
purch <- purch %>% rename(item = V1, category = V5) %>%
select(item, category)
# Create data frame for customer recommendations
recommend <- data.frame(matrix(vector(), 0, 4), stringsAsFactors=F)
# Read tsv's of existing customer recommended items.
# Items will be in six files:
# 1. Existing customer - new arrivals
# 2. Existing customer - top deals
# 3. Existing customer - what's hot
# 4. New customer - new arrivals
# 5. New customer - top deals
# 6. New customer - what's hot
recommend <- read.delim("sweetwater_existing_newarr.txt", header = F)
recommend <- recommend %>%
rename(item = V1, category = V2) %>%
mutate(page = "new arrivals", customer = "existing")
tmp <- read.delim("sweetwater_existing_deals.txt", header = F)
tmp <- tmp %>%
rename(item = V1, category = V2) %>%
mutate(page = "top deals", customer = "existing")
recommend <- bind_rows(recommend, tmp)
tmp <- read.delim("sweetwater_existing_hot.txt", header = F)
tmp <- tmp %>%
rename(item = V1, category = V2) %>%
mutate(page = "what's hot", customer = "existing")
recommend <- bind_rows(recommend, tmp)
tmp <- read.delim("sweetwater_new_newarr.txt", header = F)
tmp <- tmp %>%
rename(item = V1, category = V2) %>%
mutate(page = "new arrivals", customer = "new")
recommend <- bind_rows(recommend, tmp)
tmp <- read.delim("sweetwater_new_deals.txt", header = F)
tmp <- tmp %>%
rename(item = V1, category = V2) %>%
mutate(page = "top deals", customer = "new")
recommend <- bind_rows(recommend, tmp)
tmp <- read.delim("sweetwater_new_hot.txt", header = F)
tmp <- tmp %>%
rename(item = V1, category = V2) %>%
mutate(page = "what's hot", customer = "new")
recommend <- bind_rows(recommend, tmp)
recommend <- recommend %>%
arrange(customer, page, category, item)
# Display tables
kable(purch, caption =
"<i><font color=#000000><b>Table 1.</b> Purchase history.</font></i>") %>%
kable_styling(latex_options = "striped")
| item | category |
|---|---|
| sonuus G2M V3 Universal Guitar-to-MIDI Converter | guitar |
| AKG D112 MKII Dynamic Bass Drum Microphone with Integrated Mount | drum |
| Rode M5 Matched Pair Compact Condenser Microphones | studio |
| Shure SM81 Small-diaphragm Condenser Microphone | studio |
| Shure SM58S Cardioid Dynamic Vocal Microphone with On/Off Switch | studio |
| Shure Beta 56A Supercardioid Dynamic Snare / Tom Microphone | drum |
| Behringer U-Phoria UMC204HD USB Audio Interface | studio |
| Pro Co EG-20 Excellines Instrument Cable - 20’ Straight-Straight | studio |
| Remo Emperor Black Suede Drumhead - 14 1 $16.99 $16.99 drum Remo Emperor Black Suede Drumhead - 12 | drum |
| Remo Emperor Black Suede Drumhead - 13 1 $23.99 $23.99 drum Remo Emperor Black Suede Drumhead - 16 | drum |
| Gibson Accessories Les Paul Studio Pickguard - Black | guitar |
| Audio-Technica ATH-M20x Closed-back Monitoring Headphones | studio |
| Pro Co BP-20 Excellines Balanced Patch Cable - 20’ | studio |
| Hosa YPP-136 Stereo Breakout 1/4 TRSF to Dual 1/4 TS - 6 | studio |
| Vic Firth American Classic Drumsticks With Vic Grip - 5A - Wood Tip | drum |
| Behringer U-Phoria UMC22 USB Audio Interface | studio |
| Shure SM57 Cardioid Dynamic Instrument Microphone | studio |
| D’Addario Planet Waves PW-CMIC-10 Classic Series Microphone Cable - 10’ | studio |
| On-Stage Stands MS7701B Tripod Microphone Stand - Black | studio |
| Pro Co EGSS-15 Excellines Instrument Cable - 15’ | studio |
| D’Addario EJ11 Light 80/20 Bronze Acoustic Strings - .012-.053 | guitar |
| D’Addario PW-P047E 1/4 Male Stereo to 1/8 Female Stereo Adapter | studio |
| On-Stage Stands KSA7500 Universal 2nd Tier | studio |
| Dunlop Egg Shaker - (2-pack) | drum |
| Pro Co EXM-30 Excellines Microphone Cable - 30’ | studio |
| On-Stage Stands MS7701B Euro Boom Microphone Stand - Black | studio |
| PDP 800 Series Boom Cymbal Stand | drum |
| MOTU MIDI Express XT 8x8 USB MIDI Interface | keyboard |
| Roland RMIDI-B5-DUAL Black Series Dual MIDI Cable - 5’ | keyboard |
| Pigtronix Infinity Looper Pedal | guitar |
| Remo Pinstripe Ebony Bass Drumhead - 22 inch | drum |
| Remo Ambassador Ebony Bass Drumhead - 22 inch | drum |
kable(recommend, caption =
"<i><font color=#000000><b>Table 1.</b> Recommended products.</font></i>") %>%
kable_styling(latex_options = "striped")
| item | category | page | customer |
|---|---|---|---|
| Boss BCB-90X Deluxe Pedalboard and Case | guitar | new arrivals | existing |
| Catalinbread Sabbra Cadabra Clearwell Edition Overdrive Pedal - Sweetwater Exclusive | guitar | new arrivals | existing |
| D’Angelico Excel SS Semi-hollowbody Electric Guitar - Black Dog with Shield Tremolo | guitar | new arrivals | existing |
| Dunlop DVP5 Volume (X) 8 Pedal | guitar | new arrivals | existing |
| Electro-Harmonix Ripped Speaker Fuzz Pedal | guitar | new arrivals | existing |
| Eventide MicroPitch Delay Pedal | guitar | new arrivals | existing |
| Eventide UltraTap Multi-Tap Effects Pedal | guitar | new arrivals | existing |
| Gibson Custom 60th Anniversary 1961 SG Les Paul Standard VOS Electric Guitar - Cherry Red | guitar | new arrivals | existing |
| Gretsch G6136T Limited-edition Falcon Hollowbody Electric Guitar - Two Tone Copper/Sahara Metallic | guitar | new arrivals | existing |
| Hercules Stands GS414B Plus Single Guitar Stand with Auto Grip System and Free HA700 Strap/Headphone Hook | guitar | new arrivals | existing |
| Line 6 HX Stomp XL Guitar Multi-effects Floor Processor | guitar | new arrivals | existing |
| Line 6 POD Go Wireless Guitar Multi-effects Floor Processor | guitar | new arrivals | existing |
| PRS Limited Edition SE Parlor P20E Acoustic-electric Guitar - Antique White | guitar | new arrivals | existing |
| PRS SE Standard 24 - Tobacco Sunburst | guitar | new arrivals | existing |
| Strymon Flint Limited Edition Tremolo and Reverb - Black Knobs | guitar | new arrivals | existing |
| Universal Audio UAFX Astra Modulation Machine Pedal | guitar | new arrivals | existing |
| Boveda BVMFK-LG 2-way Humidity Control Kit - Large 3-pack | guitar | top deals | existing |
| D’Addario EXP11 Light Coated 80/20 Bronze Acoustic Strings - .012-.053 4-pack | guitar | top deals | existing |
| D’Addario EXP16 - Coated Phosphor Bronze Light Acoustic Strings 4-pack | guitar | top deals | existing |
| D’Addario Humidipak Standard Replacement 9-pack | guitar | top deals | existing |
| Dunlop 926 Lap Dawg Tonebar Guitar Slide | guitar | top deals | existing |
| Dunlop NC65 Maintenance Station Neck Cradle | guitar | top deals | existing |
| Ernie Ball Expression Series Overdrive Pedal | guitar | top deals | existing |
| Korg Pitchblack Advance Tuner Pedal - Metallic Blue | guitar | top deals | existing |
| Martin Authentic Acoustic Superior Performance Guitar Strings - 92/8 Phosphor Bronze Medium 3-pack | guitar | top deals | existing |
| On-Stage Stands Standard Guitar Stand, Cable and Clip-On Tuner Pack | guitar | top deals | existing |
| Pedaltrain Compact Gigging Pedalboard Kit with Truetone Power & EBS Premium Cables | guitar | top deals | existing |
| Pedaltrain Performance Pedalboard Kit with Truetone Power & EBS Premium cables | guitar | top deals | existing |
| Snark Silver Snark Clip-on Chromatic Tuner 3-pack | guitar | top deals | existing |
| String Swing CC01K Guitar Keeper Wall Mount Guitar Hanger 2-pack - Black Walnut | guitar | top deals | existing |
| TC Electronic Flashback 2 Mini Delay Pedal | guitar | top deals | existing |
| Two Notes Torpedo C.A.B. M+ Speaker Simulator Pedal | guitar | top deals | existing |
| Boss DS-1 Distortion Pedal | guitar | what’s hot | existing |
| Boss Katana-50 MkII 1x12 inch 50-watt Combo Amp | guitar | what’s hot | existing |
| Boss RC-1 Loop Station Looper Pedal | guitar | what’s hot | existing |
| Boss RC-5 Loop Station Compact Phrase Recorder Pedal | guitar | what’s hot | existing |
| Boss SD-1 Super Overdrive Pedal | guitar | what’s hot | existing |
| Dunlop GCB95 Cry Baby Standard Wah Pedal | guitar | what’s hot | existing |
| Fender Mustang LT 25 1x8 25-watt Combo Amp | guitar | what’s hot | existing |
| Fishman Loudbox Mini BT 60-watt 1x6.5 Acoustic Combo Amp | guitar | what’s hot | existing |
| Keeley Compressor Plus 4-Knob Compressor Pedal | guitar | what’s hot | existing |
| Line 6 POD Go Guitar Multi-effects Floor Processor | guitar | what’s hot | existing |
| MXR M222 Talk Box Pedal | guitar | what’s hot | existing |
| Pedaltrain Classic Jr SC 18x12.5 Pedalboard with Soft Case | guitar | what’s hot | existing |
| Pedaltrain Nano+ 18x5 Pedalboard with Soft Case | guitar | what’s hot | existing |
| Pro Co Rat 2 Distortion / Fuzz / Overdrive Pedal | guitar | what’s hot | existing |
| Strymon Iridium Amp & IR Cab Pedal | guitar | what’s hot | existing |
| TC Electronic Ditto+ Looper Pedal | guitar | what’s hot | existing |
| Gretsch G6136T Limited-edition Falcon Hollowbody Electric Guitar - Two Tone Copper/Sahara Metallic | guitar | new arrivals | new |
| Line 6 HX Stomp XL Guitar Multi-effects Floor Processor | guitar | new arrivals | new |
| Line 6 POD Go Wireless Guitar Multi-effects Floor Processor | guitar | new arrivals | new |
| PRS Limited Edition SE Parlor P20E Acoustic-electric Guitar - Antique White | guitar | new arrivals | new |
| Universal Audio UAFX Astra Modulation Machine Pedal | guitar | new arrivals | new |
| Korg MS-20 FS Full-size MS-20 Synthesizer (White) | keyboard | new arrivals | new |
| Black Lion Audio Revolution 2x2 USB Audio Interface | studio | new arrivals | new |
| Kali Audio LP-6 6.5 inch Powered Studio Monitor Pair | studio | new arrivals | new |
| Kali Audio LP-8 8 inch Powered Studio Monitor Pair | studio | new arrivals | new |
| KRK ROKIT 5 G4 5 inch Powered Studio Monitor Pair | studio | new arrivals | new |
| MOTU UltraLite-mk5 18x22 USB Audio Interface | studio | new arrivals | new |
| Novation Circuit Tracks Groovebox | studio | new arrivals | new |
| Yamaha HS5 5 inch Powered Studio Monitor Pair - White | studio | new arrivals | new |
| Yamaha HS7 6.5 inch Powered Studio Monitor Pair - Black | studio | new arrivals | new |
| Yamaha HS8 8 inch Powered Studio Monitor Pair - White | studio | new arrivals | new |
| Yamaha HS8 8-inch Powered Studio Monitor Pair - Black | studio | new arrivals | new |
| D’Addario EXP16 - Coated Phosphor Bronze Light Acoustic Strings 4-pack | guitar | top deals | new |
| D’Addario Humidipak Standard Replacement 9-pack | guitar | top deals | new |
| Line 6 Relay G10 Digital Wireless Guitar System | guitar | top deals | new |
| Martin Authentic Acoustic Superior Performance Guitar Strings - 92/8 Phosphor Bronze Medium 3-pack | guitar | top deals | new |
| Snark Silver Snark Clip-on Chromatic Tuner 3-pack | guitar | top deals | new |
| String Swing CC01K Guitar Keeper Wall Mount Guitar Hanger 2-pack - Black Walnut | guitar | top deals | new |
| AKG K175 2-pack Closed-back On-ear Foldable Headphones | studio | top deals | new |
| AKG K175 4-Pack Closed-back On-ear Foldable Headphones | studio | top deals | new |
| AKG K175 Closed-Back On-Ear Foldable Headphones | studio | top deals | new |
| AKG P420 Large-diaphragm Condenser Microphone | studio | top deals | new |
| Furman SS-6B 6-outlet Surge Suppressor Strip (2-pack) | studio | top deals | new |
| On-Stage Stands MS7701B Euro Boom Microphone Stand 5-pack Bundle with 5 Mic Cables | studio | top deals | new |
| PreSonus Eris E3.5 3.5 inch Powered Studio Monitors | studio | top deals | new |
| Pro Co BP-10 Excellines Balanced Patch Cable TRS Male to TRS Male 8-pack - 10 foot | studio | top deals | new |
| Pro Co BP-5 Excellines Balanced Patch Cable TRS Male to TRS Male 8-pack - 5 foot | studio | top deals | new |
| Sennheiser e 825-S Dynamic Vocal Microphone - Pair | studio | top deals | new |
| TC Electronic Ditto+ Looper Pedal | guitar | what’s hot | new |
| Beyerdynamic DT 770 Pro 80 ohm Closed-back Studio Mixing Headphones | studio | what’s hot | new |
| Cloud Microphones CL-1 Cloudlifter 1-channel Mic Activator | studio | what’s hot | new |
| Focusrite Scarlett 2i2 3rd Gen USB Audio Interface | studio | what’s hot | new |
| Focusrite Scarlett Solo 3rd Gen USB Audio Interface | studio | what’s hot | new |
| Furman SS-6B 6-outlet Surge Suppressor Strip | studio | what’s hot | new |
| Furman SS-6B 6-outlet Surge Suppressor Strip (2-pack) | studio | what’s hot | new |
| JBL 305P MkII 5-inch Powered Studio Monitor | studio | what’s hot | new |
| JBL 305P MkII 5-inch Powered Studio Monitor Pair | studio | what’s hot | new |
| PreSonus Eris E3.5 3.5 inch Powered Studio Monitors | studio | what’s hot | new |
| Rode NT1-A Large-Diaphragm Condenser Microphone | studio | what’s hot | new |
| Sennheiser HD 280 Pro Closed-Back Studio and Live Monitoring Headphones | studio | what’s hot | new |
| Shure SM57 Cardioid Dynamic Instrument Microphone | studio | what’s hot | new |
| Shure SM58 Cardioid Dynamic Vocal Microphone | studio | what’s hot | new |
| Shure SM7B Cardioid Dynamic Vocal Microphone | studio | what’s hot | new |
| Sony MDR-7506 Closed-Back Professional Headphones | studio | what’s hot | new |
# Purchase history summary
tmp_purch <- purch %>% group_by(category) %>%
summarise(count = n()) %>%
mutate(type = "purchased")
# Recommended products summary
tmp_existing <- recommend %>%
filter(customer == "existing") %>%
group_by(category) %>%
summarize(count = n()) %>%
mutate(type = "recommended")
# Merge together for plot
merged_existing <- tmp_purch %>%
bind_rows(tmp_existing)
# Plot existing customer recommendations
merged_existing %>% ggplot() +
geom_bar(aes(x = category, y = count, fill = type), stat = "identity", position = "dodge", width = 0.5) +
ggtitle("Existing customer - recommended products vs. order history")
# Recommended products summary
tmp_new <- recommend %>%
filter(customer == "new") %>%
group_by(category) %>%
summarize(count = n()) %>%
mutate(type = "recommended")
# Merge together for plot
merged_new <- tmp_purch %>%
bind_rows(tmp_new)
# Plot existing customer recommendations
merged_new %>% ggplot() +
geom_bar(aes(x = category, y = count, fill = type), stat = "identity", position = "dodge", width = 0.5) +
ggtitle("New customer - recommended products vs. order history")
Based on the above analysis, it doesn’t appear that Sweetwater’s recommender system is related to order history at all. A few alternate ideas came to mind.
I spot-checked a few items I bought to see if any of those items were frequently bought together with any of the recommended items, but this also didn’t prove to be the case.
It doesn’t appear to be random; otherwise a new customer would be equally likely to be recommended the same products as I was.
Because there was some overlap with new customers, my guess is that at least some of the recommendations were based on inventory they’re trying to unload.
I also thought it might be by amount spent, but the total I’ve spent on studio gear far outweighs anything in the other categories (I’m not including the amounts in the table, because I was mortified at how much I’ve blown on gear over the past few years).
My best guess is that they use some kind of poorly implemented clustering or collaborative filtering system, and I happen to be situated next to a customer who likes crappy gear (or I happen to have been assigned to the “crappy gear cluster”). Or maybe it’s trying to give me a subtle hint that I like crappy gear.
The fact that they didn’t recommend a single product from the drum, keyboard, or studio category–and that all recommended products were from the guitar category–tells me that maybe there is a glitch in their code that may require the attention of a data scientist.
Any way I looked at it, it wasn’t obvious to me how they were recommending products – other than “poorly.”
Because it was difficult to discern which recommender system they use, one recommendation would be to at least select a few products related to order history, possibly switching to a search-based system that uses item category from the customer’s order history.
An additional recommendation would be to place recommendation on a single page, have fewer of them, and not require a user to scroll as much to view them. I think a user is typically pretty lazy when it comes to looking for things; if it doesn’t jump out at him, I’d bet the chances he’d click on something drop exponentially.