Ryan Holbrook Profile picture
Jan 18, 2020 18 tweets 5 min read Read on X
A thread of classifiers learning a decision rule. Dashed line is optimal boundary. Animations with #gganimate by @thomasp85 and @drob. #rstats

Logistic regression {stats::glm} with each class having normally distributed features. (1/n)
Quadratic discriminant analysis {MASS::qda} with normal features. The QDA model is the same as the data model in this case, and so it fits the optimal boundary very closely. (2/n)
MARS {earth::earth} on normal features. (3/n)
Nearest Neighbors {class::knn} on normal features. (4/n)
Decision tree {rpart::rpart} with features distributed as a mixture of normal distributions. (5/n)
Random forest {ranger::ranger} on mixture of normals. (6/n)
XGBoost {xgboost::xgboost} on mixture of normals. (7/n)
GAM {mgcv::gam} with spline smoother on mixture of normals. (8/n)
SVM {kernlab::ksvm} with RBF kernel on mixture of normals. (9/n)
Neural network {nnet::nnet} on mixture of normals. (10/n)
Also, a blog post on optimal decision boundaries: mathformachines.com/posts/decision/

It has most of the plotting code. I'm planning on writing another on classifiers with the animation code. In the meantime, here's a gist:
gist.github.com/ryanholbrook/2… Image
Here is a repo with the gif files. I added an open license on the page, but basically you can use them however you like with attribution.

github.com/ryanholbrook/d…
Here's a better GAM animation (more frames!).
Gaussian process {kernlab::gausspr} on mixture of normals. (11/n)
Extreme learning machine {elmNNRcpp::elm_train} on mixture of normals. (12/n)
Mixture discriminant analysis {mda::mda} on mixture of normals. (13/n)
Naive Bayes {naivebayes::naive_bayes} on normal features. (14/n)
Boosted p-splines {mboost::mboost} on mixture of normals. (15/n)

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Ryan Holbrook

Ryan Holbrook Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(