Over a million developers have joined DZone.

How to Get Started With Machine Learning on Bluemix

The open-source framework Scikit Learn seems powerful and provides relative simple samples to get started with machine learning. In this article, we'll go over an example used for identifying hand-written digits that can be run from Bluemix.

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

There is a lot of talk about artificial intelligence (AI) these days, especially since Google’s AlphaGo beat a Go world champion. Companies like IBM are using this technology already in a number of products. For example, on Bluemix developers can easily consume cognitive Watson services like speech or image recognition that use machine and deep learning under the cover. While these Watson services are very easy to use for developers, sometimes you want to use machine learning for other scenarios.

Since this technology looks so promising and powerful, I’m trying to learn machine learning. Honestly, I only started and don’t have much experience in this space but I didn’t find it too easy to get started. A lot of articles and videos seem to assume too many statistical and data skills for me as a developer. There is also a wide range of different open-source libraries to choose from.

However, I found the open-source framework Scikit Learn which seems powerful, and, at the same time, it provides relative simple samples to get started. Below is a sample that can be run from Bluemix which identifies hand-written digits. The example is documented on the Scikit Learn website. There is also a nice video which provides some additional information.

You can run this sample easily via Bluemix. I deployed a Docker container which bundles all required components and which provides a web IDE via Jupyter notebooks.

One nice thing about Scikit Learn is that it provides some sample data for your first steps in machine learning. In this case, a dataset with more than 1000 images of handwritten digits is used.

scikit1

The core difference to classic programming is that you don’t code any longer rules. Instead, you use algorithms that find and define rules for you based on data you need to provide. SciKit Learn provides a good amount of algorithms/classifiers which developers can use rather than having to implement these rather complex algorithms themselves. This sample uses a classifier called SVC.

The dataset is divided into two parts. One part is used for training the classifier, the second part is used to test the predictions. As you can see the relative, simple code accomplishes an accuracy of 97%.

scikit2

The next screenshot shows four images which were not part of the training data and for all four images the correct result is returned.

scikit3

In order to run this sample on Bluemix, you can use a Docker image from my colleague Peter Parente. Here is an example how you can deploy the container to Bluemix (you need to replace the namespace):

docker pull parente/ipython-notebook
cf login
cf ic login
docker tag parente/ipython-notebook registry.ng.bluemix.net/nheidloff/scikit
docker push registry.ng.bluemix.net/nheidloff/scikit

After the image is available on Bluemix, you can use the Bluemix UI to run the container as done in this sample.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

Topics:
bluemix ,ibm ,machine learning ,scikit-learn

Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}