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.
Join the DZone community and get the full member experience.Join For Free
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.
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%.
the next screenshot shows four images which were not part of the training data and for all four images the correct result is returned.
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 .
Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.