Machine Learning on Rails with Ruby!

Posted by

One of the primary goals of BigML is to provide scalable, high performance machine learning services as a plug and play service for any language. Thanks to vigosan  and flype we can today announce a beautiful Ruby gem  for the Ruby community.  These two veteran Ruby hackers have graciously provided a library with all of the necessary code enabling BigML in your next Ruby project.

The library contains bindings for the BigML api. To get started, you need to require the library, and specify your BigML username and api key.

require 'rubygems'
require 'big_ml'

BigML.configure do |c|
  c.username = 'foo'
  c.api_key = 'bar'

From here, there are some easy steps to get a source loaded onto our servers, and to quickly create a dataset.

file_path = "fixtures/iris.csv"
source = BigML::Source.create(file_path)
dataset = source.to_dataset

You can retrieve existing resources using the “find” method. In this example, we can retrieve a model, and immediately make a prediction with it.

model = BigML::Model.find("4fe8868a035d07682f002891")

prediction = BigML::Prediction.create(model.resource, { :input_data => { "000001" => 3 }})

This is just a small sampling of the methods provided by the library. Be sure to visit the library repository for up to date documentation and further examples.

Ruby doesn’t have many machine learning libraries, but it’s often used as a glue language for machine learning projects, and a few  specific libraries exist.

On the other hand, there are several advantages to a clould-based machine learning service like BigML that are worth considering:

  1. You do not need to spend resources and time engineering complex machine learning or distributed algorithms on your own.
  2. All the computation is performed remotely and asynchronously by BigML so you have access to unlimited computing resources without the need to purchase or maintain machines or software packages.
  3. You can minimize distraction and focus on understanding and evaluating the insights in your data.

With the BigML libraries, you can immediately focus on how to use machine learning to bring value to your product or project, rather than focusing on implementation, scalability, and maintenance.

It’s all about removing barriers, and letting you work in a language you feel most comfortable with, whether it’s ruby, python, R, or java, BigML can rapidly bring the power of Machine Learning to your next project.  Be sure to try out our new development mode in order to test your next BigML powered project.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s