Top R Packages for Machine Learning

Top R Packages for #MachineLearning #KDN

  • Stack Overflow ranks the number of results based on package name in a question body, along with a tag ‘R’.
  • From the beginning, we envisioned our ranking being built on a combination of package downloads and Stack Overflow and Github activity.
  • However, obtaining an initial list of all the R packages for Machine Learning was a tougher task.
  • Its advantages are that the package list comes from an authoritative source (CRAN is the “official” R package repository) and it is regularly updated (last update: January 6, 2017).
  • A longer project, for another day, could be to use even more “Data Science” to come up with a ranking of the top R packages for doing “Data Science.”


What are the most popular ML packages? Let’s look at a ranking based on package downloads and social website activity.


@kdnuggets: Top R Packages for #MachineLearning #KDN

By Michael Li and Paul Paczuski, The Data Incubator.

At The Data Incubator The Data Incubator, we pride ourselves on having the latest data science curriculum. Much of our curriculum is based on feedback from corporate and government partners about the technologies they are looking to learn. But we wanted to develop a more data-driven approach to what we should be teaching in our data science corporate training and our free fellowship for masters and PhDs looking to enter data science careers in industry. Here are the results.

What are the most popular ML packages? Let’s look at a ranking based on package downloads and social website activity.

The ranking is based on average rank of CRAN (The Comprehensive R Archive Network) downloads and Stack Overflow activity (full ranking here [CSV] ). CRAN downloads are from the past year. Stack Overflow ranks the number of results based on package name in a question body, along with a tag ‘R’. GitHub ranking is based on the number of stars for the repository. See below for methodological details.

 is on top. It’s a general package for creating machine learning workflows, and it integrates well with some algorithm-specific packages, which come next in the ranking.

). See details on all of these packages below

, we may soon see it included in this list.

 is an R GUI for data mining.

 offers C++ implementations of random forests.

 is number one on Stack Overflow, but the SO API often auto-corrects this to “one” so the result is unreliable.

Below, we describe the methodology to come up with this ranking.

Step 1: Obtain an exhaustive list of ML packages

From the beginning, we envisioned our ranking being built on a combination of package downloads and Stack Overflow and Github activity. We knew that APIs existed that would provide us with these metrics.

However, obtaining an initial list of all the R packages for Machine Learning was a tougher task. This list needed to be exhaustive, objective, and up-to-date. A bad initial list would affect our ranking dramatically.

Asking around helped. A friend pointed us to the “CRAN Task View: Machine Learning & Statistical Learning” which has a great list at the bottom, and is easy to scrape.

Its advantages are that the package list comes from an authoritative source (CRAN is the “official” R package repository) and it is regularly updated (last update: January 6, 2017). Kudos to the author, Torsten Hothorn, who is also very responsive via email.

A previous thought was to use Google to look up lists of “top R ML packages” and then trying to scrape all the package names, combine them, and use that list as a starting point. But setting aside the engineering task, we also found that the currently available lists were of poor quality relative to our needs. They were outdated, didn’t clearly specify methods, and were often quite subjective.

Determine objective metrics

A good ranking needs a definition of what “best” means, and needs to be constructed with good metrics.

We defined “best” as “most popular”. This doesn’t necessarily mean the packages are widely-loved (users could be frequently searching Stack Overflow because the API is horrible).

We chose 3 components for our ranking:

CRAN downloads

There are a few CRAN mirrors, and we used the R-Studio mirror since it has a convenient API. RStudio must be the most widely used IDE for R, but it is not the only one. Our ranking could be improved (though maybe not significantly) if we aggregated downloads from other CRAN mirrors.

GitHub

Initially, we looked for the packages’ Github page by querying Github’s search API for the package name, perhaps with “language:R”, but this proved unreliable. It was sometimes hard to pick out the correct Github repo, and not all R packages are implemented using the R language (the “language:R” parameter in the search API seems to refer to the most popular language that the repository is written in).

Instead, we went back to CRAN to find these urls. Each package has an official CRAN page, which includes useful information, including source code links. This is where we got the packages’ Github repository location.

After that, obtaining the Github stars was easy with the API.

Stack Overflow

 present obvious difficulties: Stack overflow results may not be filter to results just for the R package, so we first added an ‘r’ string to the query, which greatly helped.

A good (optimal?) strategy was to look for the package’s name in the question body, and then add an ‘r’ tag (which is different from adding the ‘r’ string).

We simply ranked the packages within each of the 3 metrics, and took the average ranking. Nothing fancy.

All data was downloaded on January 19, 2017. CRAN download counts were from the past 365 days: January 19, 2016 to January 19, 2017.

This project started as a ranking of the top packages for “Data Science”, but we soon found that the scope was too broad.

Data scientists do many different things, and you can classify almost any R package as helping a data scientist. Should we include string manipulation packages? How about packages to read data from databases?

A longer project, for another day, could be to use even more “Data Science” to come up with a ranking of the top R packages for doing “Data Science.”

Source code is available on The Data Incubator’s Github. If you’re interested in learning more, consider:

Related:

Top R Packages for Machine Learning

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.