Previously, I’ve plotted a ridgeline based on a variable’s density through time. It might look nice but it’s quite obvious that time can be visualized in a more fitting way - by time itself, in an animated plot that is. So, let’s fire up the {gganimate} package again.
My goal is to show a moving kernel density curve as it moves through time, based on a moving window of 30 days sliding from the past to the present.
I really like ridgeline plots but only recently I have learned how to do them myself. Of course, the most famous ridgeline plot ever is the one you find on the cover of Joy Division’s album “Unknown Pleasures”. I wonder how many ridgeline plots done with the {ggridges} package try to replicate the look of this famous (and great!) album. And - of course - I will try, too.
tl;dr Using a Naïve Bayesian classifier and a dataset of 1515 video game ratings, I am predicting which developer is most likely to make a game with specific properties (metascore, ESRB rating, genre, platform) in the future.
Naïve Bayesian learning A Naïve Bayes classifier is a very simple method to predict categorial outcomes. A well-known application is text classification, especially predicting whether a text is spam. Here, the classifier tries to use the information about the occurrence of certain words in telling us whether an e-mail message is spam or not.
Let’s make this a quick and quite basic one. There is this incredibly useful function in R called ifelse(). It’s basically a vectorized version of an if … else control structure every programming language has in one way or the other. ifelse() has, in my view, two major advantages over if … else:
It’s super fast. It’s more convenient to use. The basic idea is that you have a vector of values and whenever you want to test these values against some kind of condition, you want to have a specific value in another vector.
There is a game I play / try to make myself okay / try so hard to make the pieces all fit / smash it apart / just for the f**k of it (Nine Inch Nails: The Big Come Down)
After this rather distressing opening by the Nine Inch Nails, let’s turn to a more uplifting topic: video games! There is a dataset on Kaggle with ratings for over 4000 video games.