Deal with Machine Learning

Volodymyr Malyk
5 min readSep 11, 2018

--

“American brown bear” by Janko Ferlič on Unsplash

Your encounter with Machine Learning is just a question of time, no matter how unlikely it seems to be. Be Prepared.

AI hype is speeding up, and new miracles regularly reveal to the public.

Machine Learning remains a hot topic in modern IT: Neural Networks, Deep Learning, Object Recognition, Natural Language Processing, and more.

Developers are talking about ML even at non-core conferences, and businesses want ML to their technological stack.

Same as Big Data a few years ago. You may paraphrase famous Dan Ariely tweet and see no difference:

Machine Learning is like teenage sex: everyone talks about it, nobody really knows how to do it, everyone thinks everyone else is doing it, so everyone claims they are doing it…

Of course, there are “founding fathers” who were in a Machine Learning business long before the hype.

Companies like SAS Institute, SPSS Inc (IBM), KXEN (SAP SE) are dealing with ML for decades already.

Machine Learning is not new, but for the first time, such a hype around it.

Developer Perspective

Machine Learning is way simpler than one may imagine.

Technically, Machine Learning is just a brute-force of the function’s coefficients until the function starts to behave as expected.

Trivial, but it can solve “algorithmically hard” problems. For example, distinguish dogs from cats.

The idea is not new — it is just the old-good Numerical analysis, familiar to Babylonian astronomers 3500–3200 BC.

Just like the Aerospace Industries use Numerical analysis to carry out hard issues, modern IT utilizes Machine Learning to deal with problems, impossible for traditional algorithms.

Machine Learning Example

“Model” is a fine-tuned function, solving some real-world problems.

If one needs an AI to set price for a taxi trip, one needs a “Taxi price Model”.

In Data Science such models are built out of a dataset and a hypothesis:

  • dataset: taxi trips with distance & price
  • hypothesis: price linearly depends on the distance

Magic:

STEP 1: price = a * distance + b, based on a linear function f(x) = a * x + b

STEP 2: fine-tune “a” and “b” till function output fit well with the dataset

STEP 3: result is a ready-for-use price = 1.2 * distance + 7

Function coefficients are fine-tuned automatically by the machine itself, depending on a function kind and dataset.

That is how “machine is learning”.

Now you can grasp why Neural Networks are hand-by-hand with GPUs. Neural Networks usually described as a System of linear equations, represented as a set of Matrices in Linear algebra. Neural Network training/production comes to operations with matrices, which are simply fast on GPUs.

So, the Art of Machine Learning is:

  • decide, which function is better for a particular real-world problem
  • know auto-tuning techniques for a chosen function

Data Scientist is not only a mathematician but also a craftsman, with a bunch of math-powered software tools under the belt.

What Data Scientist Do

There is 80/20 rule, described in the IBM blog post:

80 percent of a data scientist’s valuable time is spent simply finding, cleansing, and organizing data, leaving only 20 percent to actually perform analysis

Why?

Real-world data is big, messy, incomplete, and full of errors. Data requires careful preprocessing before feeding into the model, no matter whether training or production. That’s why useful datasets are a hot topic in the community.

Typical Model lifecycle looks like:

One can see that almost all routine focused on the data, not code. As a consequence — the fundamental gap between Data Scientist and Software Developer:

Data Scientist mindset built around data. Enormous fun to play with data and hunting for hidden patterns in data.

Coding aspects are boring and irrelevant.

vs

Developer mindset built around coding. Tremendous fun to play with algorithms and data structures.

Data analysis aspects are boring and irrelevant.

Great Data Scientist and an excellent Software Developer are two completely different people.

But they have to find common ground, especially at the final stage of a model life cycle — production phase.

Developer Tips

If you’re a Developer, who deals with Data Scientist, next tips for you.

Know what is model training, and what is model production

Model training could be done at laptop of Data Scientist in most cases. A full-scale production system is not required at this step.

Require model as a ready-to-use portable solution

Require model as a portable pack of resources and code with meta:

  • how to provide model input
  • model execution requirements
  • how to retrieve model output

Such models can be quickly built-in your data pipeline or application.

Avoid implementing model on your own by a description of model internals

Usually it happens because of the legacy and immaturity of machine learning tools in the past. In contrast, modern ML tools are designed to export models in a portable format.

For example, TensorFlow models are portable, friendly for server, mobile, and web-browser.

But if your Data Science is tied to legacy tools — at least ask to provide you model coefficients as a separate artifact (PMML, csv, etc).

Machine Learning Engineer is a well-known role

Machine Learning Engineer is a Software Developer, who deals with Data Scientists.

Searching the web for “machine learning engineer” brings tons of useful information.

A good blog post: “But what is this “machine learning engineer” actually doing?”.

Do some basic machine learning courses

You may skip “heavy” courses like Machine Learning by Stanford University.

Basic courses like Serverless Machine Learning with Tensorflow on Google Cloud Platform are good enough.

What’s Next?

Machine Learning is not a rocket science, and you may try it for your everyday tasks.

I wish your future encounter with AI hype-train would be pleasant and fun.

Forewarned is forearmed.

ps. Machine Learning is not the only hype:

--

--