Recipes

K-Means Clustering, Pokemon Go

Recipe 015: Pokemon Gen 3 K-means Clustering

FerraraTom

Take Charge of your Destiny!

In this data story I’ll be showing you how a self guided machine learning algorithm can select the best Pokemon squad for the Hoenn region.

At the end of this data story you’ll have

six Pokemon to look out for in Pokemon GO

, as well as understand why the Bagon Community Day was the best to date!


025


007_hoenn_region

As seen in the generation 2 games, the generation 3 games brought a wave of changes, especially the data structure.

Listed below are what I feel to be some of the major changes which effect the data of Hoenn region Pokemon.

Main Features added from Generation 2:
A complete overhaul of the Pokemon data structure:
Individual personality value
Abilities and Nature
The IV system went from 0-15 to 0-31
Damage such as Poison, Burn and Leach Seed (passive damage) are resolved at the end of the turn instead of immediately)
135 new Pokemon introduced
103 new moves were introduced
Weather can now be found on the field and activate at the start of a battle
Double Battles

009_pokemon_double_battles

I’d like to call out double battles, as one of the main ingredients in my Pokemon evaluation soup is : Experience Growth Rate.

Double battles allow for more and quicker experience.

In other words all Pokemon can gain more experience earlier on in the game.

021

If you recall when I looked at the data of the Johto Pokemon, we introduced to the very strong bugs.

Now in the Hoenn region we are introduced to weaker bugs.

This was done to counteract the impact of Heracross and Shuckle.

Catch these bugs below for the pokedex completion but you’re not going to have them on your main team.

022

So these weak bugs aside you do get one of (if not the most) powerful dragons: Salamence.  If you play Pokemon Go, you most likely took advantage of in my opinion the best Pokemon Go Community Day to date (Held on 4/13/2019).

008_community_day_01

One of my favorite sayings and motto is “Stay away from the brand names.”  What does this mean and how does it apply to Pokemon?  It means don’t buy into popular opinion, let the facts and data support your choices.

What’s all you hear about on community days?  If you screamed “shinys” then yes… that’s all you hear about.  How many shinys did you catch?

What’s your highest CP shiny?  I’ll trade for shinys.  Don’t be distracted by the brand name of community day, go for more than shinys.  Play in area with several poke stops and has cover from weather.

During the Bagon community day you should have been catching every Bagon spawn

, not only clicking in to see if it’s shiny.  Salamence is the goal, you want to be the mother of dragons (yes, I’m hype for Game of Thrones).

008_community_day


006_scatter_plot

Sticking to the theme of “Stay Away from Brand Names”, applying a k-means clustering algorithm will look for trends in the data and give us a group of Elite Pokemon we should replay Pokemon Ruby and Sapphire with and keep an eye out for in Pokemon Go.

How do we get to the ideal Pokemon team?  Applying a self guided machine learning approach: K-means clustering.  Now you can’t jump ahead and run the algorithm against your data.  First step is standardize your data, because you want to give each of your attributes an equal weight. 

Take for instance:

I want a well balanced team, I don’t want a team elite on attack but weak on defense.

After the data standardize and I run the k-means algorithm, you can see the scatter plot above.  The top right and far right cluster is the segment I want to build my team out of.  All other segments, you can win with but you can 100% steam roll the competition.

Below I’ve included visual representation of the top attackers and defenders in each cluster.


017


018


019


020


This is great, love info graphics… but what do we do this knowledge?  Well we can build a team.

Your team building begins from the very beginning.

I’ll cut to the chase… you should chose Torchic (sorry Swampert fans)

026

Why Torchic? Well I’m concerned about team structure and most importantly a showdown with Slaking (Fighting moves are must).  Below you can see the full recommendation of what your final team should look like.  You should also target all of these in Pokemon GO.

 

024


005

027


028

nintendo, Propensity Modeling, Super Mario

Recipe 014: Smash Brothers Main Selection

FerraraTom

In this recipe I’d like you to chow down on a Smash Brother analytical approach to selecting your main character.  The approach I’m going to introduce you puts an emphasis on what makes a character unique.

pancakes_smash


 

009_overallclust

Before I start diving into the Smash Brothers data, let’s discuss the k-means clustering approach.  A k-means helps paint a clear picture of our data, in this case specifically it will identify Smash Brothers Characters by their attributes to create picture for who your main should be.  Our characters will be assigned into segments

(tiers… everyone loves to put tiers around Smash Characters but they’re based solely on opinion and player preference)

based on trends in our data, and how closely a character is to the a group.

Take the above picture, without applying this approach we are in the top left quadrant, we only have a faint idea of who should be our main.  As we apply more segments and more trends in the data we’ll eventually end up in the bottom left quadrant.  A clear picture of who our main should be.

Now I keep mentioning trends in our data.  How do we find trends in data where attributes are on the surface completely skewed and non-normalized?  Take for instance a characters weight as a whole number will be larger than a characters acceleration rate in the air (aerial attacks).

We can achieve these trends by standardizing our variables, setting all variables to have a mean of zero.  In doing so this analysis focuses strictly on the trends in our data and we can have a pretty interesting discussion: i.e. Yoshi is more similar to Kirby, than he is to Pac-man.


 

Super Smash Bros Ultimate Mural

 

In preparation for this data story I came across the following article, on Business Insider: “These are the 11 best ‘Super Smash Bros. Ultimate’ characters, according to the world’s number-one ranked player

Here’s an excerpt from the article:

final

And here is ZeRo being named the best overall player:

final_001

This triggered a thought in my head and I haven’t done this on the Pancakes Analytics page yet, but typically you would bring a k-means cluster in production and re-score your segments on an agreed upon cadence.  In this case I’ll treat the release of a new game as the cadence.

I’ll run a k-means clustering on the character attributes in Wii-U version and then a k-means clustering on the same character attributes but for the Switch version.

While going through this process I’ll only be including those characters who were in both games and where the data is clean: i.e. all characters have a weight and all characters have available acceleration data.  Sorry Inkling, you’re not in this segmentation.

001_clust

002_clust

Above are both segmentation cadences and characters will be split into these segment tiers:

  • Floaters (Far right circle)
  • Jack of all Trades (Smack in the middle)
  • Dashers (Faster than your Jack of all Trades segment but not fast enough to be elite in that attribute)
  • Air Tanks (The bottom left circle)
  • Speedsters  (Top left circle)

These aren’t ranked by what tier is the best, but we can make some assumptions.  The Jack of All Trades segment, most likely you won’t be winning matches often but you’ll be competitive.

Smash Brothers is a unique fighting game, so characters do have a weight to them.  Being light weight does have it’s advantages, but the learning curve of playing as a Speedster might be too high risk high reward for you.

The Floaters, if you select someone with a weight advantage in this group, you’ll likely to win your match but you have to master the move set (your smash move).

Air Tanks, is a no brainer I think for any skill set.  If you want to have a high likelihood of lasting till time runs out, be an Air Tank (this won’t guarantee a win, that really depends on your competition).


 

003_gandorf

I’m hoping visual this stood out to you the reader: Ganondorf made a large leap from the Air Tanks to the Floaters.  This doesn’t only speak to Ganondorf but it also tells you information about Bowser as well.

When I speak to this to clients and those wanting to learn about a particular data, this is how it translates:

Ganondorf has more in-common with Jiggly Puff than he does Bowser.   The reason being is he’s quicker and can adapt well in aerial attacks and in falling than Bowser can.

On the flip-side of this I can also say Bowser more accurately represents how he’s viewed from the super Mario franchise, in Super Smash Bros. Ultimate.

Neither one of these characters were “nerfed”, only re-calibrated so there’s a distinct difference between the two.

What do you do with this information?  If you’re main is a Floater, Ganondorf would be a good transitional character if you were looking to play as a character with more weight.  Or say you always play as an Air Tank, because you have the assumption anyone who has Kirby as a main shouldn’t be playing Smash Bros. then Ganondorf is a good transitional main for you when you eventually given in and select Kirby, “by accident”.

Image result for kirby smash


 

Below are the segments a brief overview of those characters within each segments:

004_floaters

This segment has high variability and you can see this from the oblong shape of the circle.  Ganondorf and Jiggly Puff are driving this shape, all though they are in the same segment and are more similar to each-other than are to other segments, they are the furthest apart within this segment.

Now hold up… wait a second.  Didn’t I just try to prove a point of how similar they are?  Yes, but in relation of whose more similar to Ganondorf: Jiggly Puff or Bowser.  But if I posed the question who is more similar to Ganondorf: Jiggly Puff or Kirby… that answer is Kirby.

This group on average are the slowest by run speed and lightest by weight… they Float.


 

005_jackofalltrades

This segment is the medium of everything.  There’s no uniquely distinct trend in their data.  Now playing as Pikachu vs Mega Man would have so game-play differences but statistically speaking you are starting with same underlying stats.

If you’re new the series this a good group to start with… they’re a Jack of All Trades.

 


 

006_dashers

The Dasher segment is very similar to the Jack of All Trades segment, only slightly faster.  Playing in this group you could potentially do more harm than good, if you’re selecting because you want to stay middle ground. You could… Dash yourself off the area.


 

007_airtanks

Air Tanks are fast in the aerial attacks… and the heaviest?  I’m anticipating this group will be re-calibrated by the next release.  In other words… Bowser has no business being as effective as he is in the air as he weighs, normally these two variable don’t correlate.  I guess all the time battling a plumber who can flip and jumps is finally paying off.


 

008_speedsters

This is your high risk high reward group.  Characters in this segment are the fastest and the lightest.  I personally am awful playing as Sonic, he’s too fast for playing level but a seasoned player could probably mop the floor with Sonic.


for_post

So who should be your main?  In this segment I rely on industry knowledge as well (ZeRo’s tiers as dependent variable).   I’ll build propensity score with the following independent variables:

  • Change in air acceleration
  • Base air acceleration
  • Base speed in the air
  • Base Run Speed
  • Character Weight
  • Ultimate Smash Bros. Cluster
  • Wii-U Smash Bros. Cluster

propb

The output will give me the likelihood ZeRo would rank the character as a top tier character.  The highest influencers on predictability were:

Change in air acceleration

Run speed

The lowest influencers were:

Base air acceleration

Ultimate Smash Bros. Cluster (this highlights the bias towards the Wii-U stats, influencing ZeRo’s rankings)

Drum roll please….

main1

main2

main3

You should have your main be one of the above three.  This is the data solution to selecting your main.

Really looking forward to the comments section on this one 🙂


005

final_002


003_008

Marvel Comics, Propensity Modeling, Regression Modeling

Recipe 013: Marvel Comics Propensity Score

FerraraTom

How crazy would it be if I told you Howard the Duck and Old Man Logan are closer to each other in skill sets than they are to any other Marvel characters?  Or how about Thor and Dr. Octopus are lookalikes as well?  Let’s answer these questions together by wrangling some readily available data.


 

008

 


 

001

If I’ve learned anything from my career in data science it’s this: 80% of the work is data gathering and etl work, and 20% is analysis.

Nothing holds truer to this statement than finding data of Marvel characters skills set, on a normalized scale.  In this data story I’ll be using data from Marvel Contests of Champions (power index levels, health and attack) and the Marvel Battle Royale (a twitter fan poll of greatest superheroes).

A few more variables I’ll need to calculate around the results of the Marvel Battle Royale Twitter Fan Poll:

Total votes per each round

Average Total votes

A flag for if they were higher than average total votes per marvel character

This flag I’ll use as my dependent variable and my independent variables will be the Marvel Contest of Champions statistics.

What will this do?  This will predict the likelihood a Marvel Character would receive higher than the average total votes in the Marvel Battle Royale.

Once this is calculated I’ll receive an output of coefficients which I can apply to the rest of the Marvel Characters whom weren’t in the Marvel Battle Royale to create a propensity score.


 

002

Now let’s back track a little bit and see why I’m going with a propensity model as opposed to a grouping by opinion.  I.e. Let’s put all the top attackers in the same category.

The top 3 characters based on Attack are Rocket Raccoon, Spider-man (Symbiote), and Blade.

In the above histogram, if you look all the way to the far right you’ll notice they are the data points on their own little island.


 

 

003

Well what if I just grouped everyone by Health?  This data visualization looks more promising but mostly likely there would overlap on the other attributes and you wouldn’t be able to implement this successfully.


 

004

The power index by definition could be suitable but from the top 3 selected on power index I can tell this rating wasn’t an index in the vein of what I would typically use an index for (time-series forecasting) and it looks to be similar to the Pokemon Go Combat Point System, the ability to use their full potential.


 

005

One use of a propensity score is to create similar groups, based on the likelihood of performing a behavior.

In this case Doctor Octopus and Thor (Ragnarok) statistically the same in the Marvel Contest of Champions skill set.  For those of you want to go down and interesting rabbit whole, you can find YouTube videos on why Doctor Octopus should be in a demi-god tier.

This propensity score approach literally put Doctor Octopus in the same tier as a demi-god!


 

006

Medusa by power index alone would be close to Thanos but factoring all skill sets, she is statistically closer to Gwenpool, Cable, and Nightcrawler than she is to the Mad Titan.


 

007

Now for the crazy but statistically significant section.  Howard the Duck (I’m hoping he gets a show on Disney+) and Old Man Logan are a propensity score match.

An example like this where many begin to argue in data science, when does subject material expertise come into play?  We can argue significance forever, on any topic, but we can agree on all Marvel Champions have a value if played correctly.


006

009


 

005

010


003_008

Uncategorized

Recipe 012: Pokemon Gen 2 K-means Clustering

FerraraTom

Thanks for coming for a bite, let’s dig into some pancakes and the data science behind the Pokemon of the Johto Region.  How do they differ from the Kanto Region?  What’s the importance of introducing two new Pokemon Types?  Finally how speaking about the trends in our data will help us understand the relational differences and similarities beyond Pokemon general typing!


012_receipe


 

gyarados_en_265x240

Pokemon Gold and Silver ushered in a new era for the Pokemon series and listed below are few changes (not listing all the influential game changes in this post) which still have a large influence through this day:

The introduction of Shinies (Shiny Gyarados shown above)

Gender types

Eggs, breeding and babies

The experience bar

Two new Pokemon types: Dark and Steel

increase_in_bugs

I want to touch base on specifically two items in the above list and how they effect the overall re-balancing of the Pokemon universe (see above the increase of stronger bug type Pokemon) and how it’s driving difference between generation 1 and generation 2.

Eggs, breeding and babies

Two new Pokemon types: Dark and Steel

How do Eggs, breeding and babies influence the trends in our data?  For instance there’s more normal types added to the mix (+1%) but the average base attack (-8%) and base defense (-2%, even with the introduction of Blissey!)  have both declined versus generation 1 (Red and Blue).

rebalancing

How do the introduction of two new Pokemon types: Dark and Steel influence our trends?  For those of you have played gold and/or silver you know this is longest nameplate in the Pokemon series to date because you also travel back to the Kanto region (Where psychic and ice types reign supreme!).

Dark type Pokemon are super effective against Psychic and Ghost types.  They’re vulnerable to Fighting, Bug and Fairy types.

Steel type Pokemon are super effective against Rock, Ice, Fairy and Dragon types.  They’re vulnerable to Fighting, Ground, and Fire.

Bug type Pokemon are super effective against Psychic, Grass, and Dark.  They’re vulnerable to Flying, Rock and Fire.

Dark and Steel types where introduced to re-balance the game and give the player the tools to be prepared for the Kanto region challenges.  In doing new and stronger Bug type Pokemon (think Heracross and Shuckle) were introduced to add a check in place for those trainers who go on a full on attack against Psychic type Pokemon (Dark and Grass types [counters to Mewtwo]).

Now we’ve dug into the differences of our data from generation 2 to generation 1 we can begin focusing on generation 2 and how we can apply a guided machine learning to building the best Pokemon Johto team we can!


011_remove_outliers

While training this model, I uncovered a segment full of only legendary Pokemon, although you can get these Pokemon in the game I will be removing them from this analysis, for a few reasons:

They’re overpowered compared to the rest of the population.

They’re meant as a reward.

It’s not very insight full to know the legendary dogs have more income with other legendary Pokemon as opposed to a baby Pokemon.

Let’s continue…


010_standardize_vars

In my segmentation I’ll be throwing in several key performance indicators for Pokemon value throughout the game ranging from base attack to experience growth rate.  How do I get these vastly different attributes on the same scale?

Through standardization!  Standardizing my variables to a mean of zero will put a heavier weight on the trends within the data, as opposed the individual weight of each variable.

002_amount_of_clusters_plot

How do I determine the proper number of clusters?  I’ll analyze this elbow graph and look for an error where my sum of squares begins to bend (as an elbow would).

From first glance I begin to see the shift at 4 groups, then a slight change at 5 groups and vast difference at 6 groups.  What does this tell me? Possibly one of clusters has high deviations and variability on the attributes selected for clustering.


001_comp_plot

Understanding I might have a group with high variability and seeing there isn’t a large difference from 4 groups to 5 groups, I decide to plot a 4 cluster solution.

Visualizing our data in this way (plotting my the top two components [ which accounts for 60.33% of the variability in the data]) show me two things:

The relationships between Pokemon beyond general type.

My group to the far right, if I ran a 6 cluster solution would have large overlap and possibly a smaller cluster smack in the middle of it.

Now that we’ve done this let’s learn about the Johto Pokemon…


003_elite_info

My top tiered Pokemon group is a clustering of elite scored attributes, which explains the variability.  Above you can see the type breakdown and the top base attack and top base defense Pokemon within the group.  I like this display because it puts the emphasis on how introducing Dark, Steel, and more stronger bugs have influenced the Pokemon universe.  During a previous analysis (Which can be found in the kitchen!) I did the same approach for the Kanto Pokemon and Psychic types were the top attackers.

004_valuable_info

The next tier is the Valuable tier, Pokemon fall in this tier because they are borderline elite in one attribute but overall well balanced.  Think of these Pokemon as the Jack of All Trades.

005_medium_info

The Medium value tier has more variability on Pokemon type, and are Pokemon which evolve in most cases (all three starters fall in this group) but not all (see Dunsparce).  Pokemon in this tier if left as is and never evolve…. will never migrate to the upper tiers.

006_low_info

All Pokemon have value when trained to their full potential and this is why my bottom tier is called Low Value.  Pokemon in this tier will take time and patience but do offer unique attribute scores which can be useful at higher levels.  As seen above Granbull’s family tree begins in this tier.  There’s an opportunity to migrate from the Low value tier to the Valuable tier if you train, train, train!!!


009_shuckle_003

Now that we’ve gone through this exercise what unique findings can we come up with?  Possibly something you didn’t already know.

Shuckle has more in common with Tyranitar than Miltank.

Shuckle’s unique combination of Elite base defense and hp, out weighs it’s lower scored attacks, to take it’s place among the Pokemon powerhouses of the Johto region.

Thank you for reading this data story and if you have follow-ups or would like to continue the discussion direct message me on Instagram @pancake_analytics !

Enjoy your breakfast!


005

panackes_yum


 

003_008

DC Comics, K-Means Clustering, Logistic Regression, Propensity Modeling

Recipe 011: DC Super Hero Throw Down: Propensity Modeling

FerraraTom

I want you to remember, Clark…In all the years to come… in your most private moments… I want you to remember my hand at your throat… I want you to remember the one man who beat you.

Chilling quote isn’t it?  That was said by Batman to Superman during the The Dark Knight Returns, a comic book miniseries written and drawn by Frank Miller.

One of the greatest debates in comic book lore and a fun discussion to have is pitting up two superheroes against each other… Who wins and why?  The below data story will introduce a data science approach to answering this debate.  To have fun with it… I’ve thrown characters from the video game Injustice 2 into a Superhero Thrown Down Tournament.


012_pic

 

 


010_pic

Before we dive into the tournament and the results of the throw down, I’d like to touch on the approach: Propensity modeling.

Propensity modeling has been around since 1983 and is a statistical approach to measuring uplift (think return on investment).  The goal is to measure the uplift of similar or matched groups.

The heart of this approach lies within two machine learning approaches (segmentation and probability.)

Why propensity modeling for this exercise?  I wanted to rank my superheroes for the bracket using statistics (i.e. Batman is not getting a number one seed.)

35 characters were segmented on strength, ability, defense and health.  For the propensity score I gathered ranking information from crowd sourced websites and surveys.  Using this I was able to give an intangible skill score.  The reasoning was I wanted the medium of comics to do the majority of the work for me.  Comics are stories and the narrative drives the inner core of a character.  The higher a character is on a fan sourced website I’m assuming they are written well and are timeless.

Next step was to take the mean of the intangible skill score and flag those characters above the average (this will be my dependent variable for my logistic regression to calculate a propensity score).

What was thrown into the propensity model?  The skill sets gathered from the Injustice game, the assumption here is a character of Superman’s skill set would be written much differently then say Catwoman.

011_pic


Now it’s time for our throw down.

001_pic

The top four characters by propensity score were:

Cyborg

Supergirl

Aquaman

Black Adam

To determine a winner in the throw-downs characters were put up against each other in 11 categories.


Round 1 Takeaways:

002_pic

Our number one seed Cyborg nearly lost to Atrocitus. The result was 6-2-5, that’s read as six wins, 2 ties and 5 losses.

There were no upsets in the first round of play.  A few characters did not win a single category in their match-ups:

Harley Quinn (vs. Captain Cold)

Green Arrow (vs. Batman)

Black Manta (vs. Black Canary)

These three characters were ill-equipped to take on their opponent, it is possible they would have advanced given a new opponent.

003_pic


Round 2 Takeaways:

004_pic

Cyborg (our number one seed) defeated Captain Cold by a larger difference (+3 winning categories) compared to the previous match-up against Atrocitus, but he scored one win less.

We begin to see upsets in Round 2:

Robin defeated Black Adam by 1 winning category.  Wonder Woman defeated Firestorm by 4 winning categories.  Batman defeated Supergirl by 3 wining categories.

On propensity scores these were upsets, but from comic book debate standpoint you could argue these, i.e. given enough time to prepare Batman could defeat Supergirl.

005_pic


Round 3 Takeaways:

006_pic

Cyborg falls to Superman, loss by 4 categories.  This was the biggest fight Superman was given in this tournament to date (in both previous rounds he had 9 winning categories).

The upsets keep coming in:

Robin sneaks in a win again by 1 winning category (over Brainiac). Wonder Woman defeats the top seed in her region of the bracket (Aquaman) by 4 winning categories.  Batman defeated Green Lantern by 3 winning categories.

007_pic


Final 4 Takeaways:

008_pic

Robin’s Cinderella story comes to an end at the hands of Superman (winning in 9 categories).  Robin did fair better than those previously who gave Superman 9 category wins… Robin won in 2 categories.

Batman was able to upset Wonder Woman, by 2 winning categories.  We’re set for a championship round, the original who wins… Batman Versus Superman!

batman-vs-superman-movie


Our winner is…

009_pic

Superman defeats Batman.  Superman did not win in a landslide.  Batman loss by two categories but he was able to win in 5 categories.  Previously the highest total win categories against Superman were 3 winning categories.


What did we learn from diving into the DC data?  Comic book writing and fan perception goes along way in determining who wins a thrown debate.  If we use propensity modeling we can have more even playing field and limit the amount of unfair battles.


005

SupermanPancakesW


003_008

nintendo, Regression Modeling, Super Mario

Recipe 010: Mario Kart Game-play Improvement Controller Trials

FerraraTom

Before I dive into this week’s data story, let me state why I love the Nintendo Switch.  I personally feel there’s a need for video games to be a social event, and couch co-op is a must have feature.  The Nintendo Switch offers several games which meet this need.

My family loves playing video games and most of all we love playing video games together.

Most of the Nintendo games I’ve grown up on and have played over the years, Mario Kart by far is one of my favorites.  I’ll admit my wife shows me how it’s done.


001


002


003

What I do find interesting about the Nintendo Switch is the joy con controllers, there’s a learning curve (but a huge improvement on the Wii-mote) and most veteran gamers prefer an alternative.

One alternative is the wireless controller, very similar to the X-box controller format.  I did pick up the Yoshi version for my wife and she loves it and personally feels it improves her game-play.

I’d thought it was time to put this notion to the test, what impact if any does a wireless controller has on game-play performance versus using a joy con.

Mario Kart seemed like the logical choice for this is experiment, it’s a multiplayer game, you can standardize your users (via ride type and modifications), and performance is measured in a continuous variable of points.

004


005

A total of 8 trails were ran under these conditions:

-Standard Kart

-Standard Wheels

-Standard Flyer

-Mushroom Cup

-50 cc length race

-2 gamers

Half through the trial one gamer switched to the wired controller (Test group) while the other gamer stayed on the single joy con (Control group).

Results were documented, and the etl. process began, points scored each race would be used as the key performance indicator.

I next ran a linear regression (great for evaluating an A/B test), with my dependent variable being the points scored after the event (introducing the wired controller) the two independent variables: Treatment and Pre Points Scored.

006


007.png

In this model I wasn’t concerned with the r-squared value or the significance level of each variable.  The sample data was not large enough, this was closed circuit small market test.

The model itself did show to be significant, which is a good indicator I can continue with the results.  Evaluating my Q’s graph, I see the model fits well, the trend goes through all the data points.

In my summary fit I notice there is a positive relationship between treatment (group) and post points scores.  At first glance this says you improve your Mario Kart game-play performance if you play with a wireless controller.

To complete this story I want to know my upper confidence level to be able to know by how many points and is this enough to move me up the rankings.

Using a wired controller has the potential to increase a gamers point performance by over six points each race.

The average points differential between race placement is 1.2 points.  This 6-point increase is enough to move you roughly 4 places, depending on your historic placement.

008.png


009

What have we learned from diving into the Mario Kart Data?

The controller you play with matters, switching to a traditional wired controller can potentially improve your point score by 6.5 points,

which depending on your average race placement can move you up 4 places in the final standings.

Observing the CPU controlled racers, Shy Guy performed the best with an average final placement of 2.8.  The heavy class overall was the weakest group but without Bowser, it could have been worse.  Bowser’s average final placement was 4th.

 

After you have consumed this meal, I hope you take these findings and enjoy your next Mario Kart Grand Prix.  Also as always enjoy the featured pancake recipe below!


006

010


005

011


003_008

Classification Tree, Game of Thrones, Tree Based Models

Recipe: 009 Game of Thrones Survival of the Fittest

FerraraTom


“When you play the game of thrones, you win or you die.” — Cersei

Let’s bring this quote to life in what I like to call a survival tree of the fittest.  This week’s analysis will focus on the character survival in Game of thrones.  Chow down and enjoy!


001


002


003

Winter is coming and you’d like to know your chances of survival in the Game of Thrones universe.

Let’s learn from those who have survived to this point and those who have met their unkindly fate.

To do this I’ll build a classification tree with my event being set to is the character alive (1 for yes, 2 for zero).  Classification trees in general test the null hypothesis, when we reach my tree visualization I’ll assign the color red to instances of were it’s highly probable of a character death.  Green leaves will indicate it’s highly probable a character survives… as long as all this criteria is met.

Think of this tree as a really morbid family tree, but since the data is Game of thrones it fits right into place.

The variables have readily available to me (hopefully they have importance) are as follows:

  • House Affiliation
  • Member of nobility
  • Marital Status
  • Gender
  • Family history of deaths
  • Popularity

004


005

From the initial read I see knowing if a character is popular among fans and if they are male hold the highest importance in determining survival.

Also the variables I have available account for 75% of the variability (a 25% miss-classification rate).

Let’s say you moved to Westeros, out of the gate you have a 25.4% chance of meeting your end.  At those odds I’m taking my chances but I should stay under the radar as much as I can, because the data warrants it.

If you become a popular character or are an integral part of the story, your death becomes more meaningful and your probability of survival is worse than a coin flip.

So let’s say you’re a like-able character (you can’t help it), not all is loss, as long as you’re a female.  The highest survival rate is the popular female character group.  This is a classic tale of high risk high reward.

006


007

A classification tree is a great way to visual your data and now I’ll walk us through this Game of Thrones survival tree.

Let’s start at the very top, the tree assumes everyone has a 75% of survival.  Now as the tree splits this Is where the interesting part begins, and our data story begins to unfold.

If you are a popular character you flow to the left side of the tree, your survival rate of 75% now drops to 48%.

Staying to the left side of the tree there is another important split, are you a male or female?  Female characters have a higher probability of surviving (87% if you’re popular and 76% if you’re under the radar).

If you’re a male and you’re popular you have a 42% chance of survival (We’re looking at your Peter Dinklage).

Now here’s the largest caveat to take with this classification tree: I’m assuming it will no longer be relevant after the final season.  Winter is coming and most likely our characters will see their end by hands of White Walkers.


008

What have we learned from diving into the Game of Thrones Data?

Everyone has starts off at a 75% survival rate and as your popularity grows your survival rate lessons by 27%.  If you’re a male your survival drops again by 33%.  If you’re a popular female character you are 45% more likely to survive versus your male counterparts.

An interesting tidbit…If you become popular and you are a female (hopefully the mother of dragons) you boast the highest survival rate of anyone in this universe, 87%.

 

After you have consumed this meal, I hope you take these findings and enjoy your episode of Game of Thrones. J  Also as always enjoy the featured pancake recipe below!


006

https://gameofthrones.fandom.com/wiki/Game_of_Thrones_Wiki


005

009


003_008