__STYLES__
🎃 Halloween is creeping up, and you know what that means—Candy Season is here! 🍬 Using data from 296,000 matchups and 85 different Candy Types, I’ve created the ultimate Candy-Picker. Just choose your candy preferences, and it will instantly reveal the top 3 treats you’re sure to love! Need candy for someone else and don’t know what to get because you do n ot know their prefrences? Let Mr. Pumpkin lend a hand and help you pick the perfect sweets mix (Out of 3 Candies) that are guaranteed to be a hit! 🍭👻
I decided to go for a Candy-Picker because in my opinion Halloween should be fun! And with the Candy-Picker you can also identify easily Dracula's Tip for the MIX OF 3 ALL TIME BEST CANDY FOR EVERY FLAVOR. Which is the perfect Mix to buy for a Give Away if you do not know the other person's preferences. By hovering over the nose of Mr. Pumpkin, they will be revealed.
Project data: CSV table
As some data were given in a non optimized way I splitted out the ingredients in a separate table.
For candies where all the given categories were false, I created an entry in the 'Others' column. After doing so, I transformed the table into a list with only two columns, eliminating the false and null entries. This resulted in a list where I can filter the data by the given ingredients.
As I wanted to display all the ingredients, I created a column in a third table by performing some transformations. That column was later merged into the main table
So the final data model looks like that.
The percentile of the price and sugar was used to categorize the Candies into
Low - percentile <=0.33
Middle - percentile <=0.667
High - percentile > 0.667
Furthermore a Sugar Rank and a Price Rank was calculated out of the percentile. To give the user a feeling how the Candy ranks compared with the 85 Candies. Rank 1 means it is the highest price or the highest sugar content.
Rank = (1-p)*(n+1) where n = 85
After doing this the model was ready to go :)
As I've been working on a lot of business cases lately, I wanted this challenge to be more of a fun project. So, I decided to create a Candy Picker—because I personally love tests that let you discover something. My idea was to design a Halloween-themed Candy Picker where users can choose their preferences and receive three candy recommendations. To ensure three foolproof options, I introduced 'Mr. Pumpkin.' If you're unsure about anything, you can hover over Mr. Pumpkin's nose, and he will suggest a mix of three candies for every flavor..
With the Candy Picker it was also easy to determine a winnign candy mix, Because I could see for every flavor the top 3 candies. And in some flavors they were pretty similar. So I put an eye on chosing low sugar if possible and choosing a Candy of every flavor.
To achieve this, I wrote several DAX measures that filter out the first, second, and third best candies based on the ingredients and their win percentage.
Inspired by the great video of Alice Zaho I tried to do the PCA Analysis with RStudio to double check my choices. It was not as easy as I thought But in the end it worked out.
To do so I used this R-Code:
install.packages("factoextra")
install.packages("ggplot2")
#Load libraries
library(factoextra)
library(ggplot2)
str(candy_data)
summary(candy_data)
Candy_Sample <-candy_data[,-c(1,11)]
Candy_pca<-prcomp(Candy_Sample,center=TRUE, scale=TRUE)
summary(Candy_pca)
names(Candy_pca)
Candy_pca$x
fviz_eig(Candy_pca,addlabels=TRUE,ylim=c(0,70))
fviz_pca_biplot(Candy_pca)
The result of that was this picture with the contribution of the nine dimensions
And the plot where you can see the clusters:
Afterwards I copied the factors for Dimension 1 and Dimension 2 and used them in Power BI to create a Scatterplot. For doing that I added some Jitter in Power Query to avoid multiple dots being exactly in one place.
The Scatterplot can be filtered by winpercent, Sugar Content and Price Segment.
I really loved this project because it allowed me to get creative with the design, and since I love Halloween, it was a perfect match. It also fit well within the required time frame, as the data was minimal, and with a few clever tricks, I could easily use it to create the Candy Picker. I hope you enjoy it as much as I did, and have fun picking your favorite Halloween candy!