Open Sourcing the Civis Data Science API Client for R

September 27, 2017 Keith I.

It’s frustrating to reinvent the wheel just to do basic data science. We’ve experienced that here at Civis, which is why we’re always automating these tasks by adding them to the Civis Data Science API. By coding with the Data Science API, you can take advantage of everything Civis Platform can do, including our favorite data science workflows, like CivisML for building models at scale with scikit-learn.

Today, we are pleased to announce we’ve open sourced civis-r, the official R interface to the Civis Data Science API. With civis-r you can use the cloud compute, machine learning, and reporting capabilities of Civis with your favorite R tools. If Python is your language of choice, see our previous post on open sourcing the Python client and this post for examples of how the Civis Data Science API can make your life easier.

So what can you do with civis-r? For starters, you can move your data to and from the cloud with a single line of code. Your data can be stored as rows in a table, CSVs on a remote file system, or even as serialized R objects like nested lists. For example,

library(civis)

# First we'll load a data frame of the famous iris dataset
data(iris)

# Next we'll push it to a database table
write_civis(iris, "schema.tablename", "database")

# Great, now let's read it back
df 

Civis-r also includes functionality for working with CivisML, Civis's machine learning service. With the combined power of CivisML and civis-r, you can build models in the cloud where the models can use as much memory as they need and there’s no chance of your laptop crashing.

library(civis)

# It really is a great dataset
data(iris)

# Gradient boosting or random forest, who will win?
gb_model 

Huh, I guess we'll call that a tie.

I could keep going on about the features in civis-r, including publishing reports or predicting on huge datasets in parallel, but I don't want to spoil the joy you'll get from discovering on your own. You can start the journey with the full documentation, creating an API key and, of course, installing:

install.packages(“civis”)

Hope you enjoy civis-r,

Patrick and Keith

library(ggplot2)
library(purrr)

ts 

This post was co-authored by Patrick M.

The post Open Sourcing the Civis Data Science API Client for R appeared first on Civis Analytics.

Previous Article
Civis Bookshelf: Food stamp timing, pandas, image synthesis, and Reddit politics
Civis Bookshelf: Food stamp timing, pandas, image synthesis, and Reddit politics

This post is part of our Bookshelf series organized by the Data Science R&D department at Civis Analytics. ...

Next Article
Civis Bookshelf: Fairness Modeling, Creating a Hurricane Graph & More
Civis Bookshelf: Fairness Modeling, Creating a Hurricane Graph & More

This post is part of our Bookshelf series organized by the Data Science R&D department at Civis Analytics. ...