Your First Machine Learning Model

Aoun Lutfi
AstroLabs
Published in
3 min readSep 26, 2017

Machine learning is the new hype. Many companies are scrambling to hire data scientists to start making sense of their data. As such, this data can be anything from images to emails to financial data. Surprisingly, it is rather easy to get started with data science and machine learning. With a brief background and understanding of certain concepts, one can easily develop a simple machine learning model to do pretty much any kind of pattern identification.

As a starting point, images are one of the easier to deal with, using something known as a convolution neural network (CNN), you can easily train it to identify what is the content of the image. CNNs are a special type of something known as a Neural Network, which is made up of a group of something called a Perceptron. A perceptron is a linear mathematical function has the form of Y=wX+b. These are then connected in layers.

The difference between a CNN and a normal neural network is that:

  1. It has multiple “hidden” layers, thus called a deep neural network
  2. It uses the mathematical function of Convolution to identify features in an image.

Armed with this knowledge and the right tools, you can easily build your own neural network to apply optical character recognition (OCR) and identify text. My favorite tools to start with are:

  1. Python programming language
  2. Data Science Experience
  3. TensorFlow

Python is my favourite programming language and one of the best languages for data science in general, primarily because it allows you to focus on the logic by simplifying the syntax and offering a set of libraries to assist you. As for Data Science Experience (DSX), it is a notebook on the cloud that allows you to write code and description of the code which is shareable and reproducible. Also, it runs on the cloud which provides you with the processing power required to run and train complex models. And finally, TensorFlow is an open source library available in python and C and can run in DSX which provides you with the tools needed to quickly and easily write and train machine learning models.

This link points to a python file that actually implements this. It uses TensorFlow to classify a set of character images and identify what letter is in the text. The data-set is known MNIST, which is a very common data-set in OCR and TensorFlow tutorials.

If you head over to DSX and create a free trial account, you will see the dashboard below. In the dashboard, create a new project, then add a new notebook running python on Spark 2.0. This should allow you to copy the content of the python file onto the notebook and run it.

DSX dashboard

--

--

Aoun Lutfi
AstroLabs

AI Solutions Engineer, Avid Researcher and Developer — Using AI to power the world💡🤖