Make your way…Machine Learning

lh1008
9 min readJan 25, 2020

What is Machine Learning?

Machine learning is a variant of what we have heard of what Artificial Intelligence (AI) is. AI, in a few words, is the intelligence demonstrated by machines. AI is a simulation of human behavior, for example, understanding language, recognizing objects/sounds, problem-solving, etc. AI is focused on three pillars, learning, reasoning, and self-correction.

Humans have been working hard to make machines think. But, have we ever wondered if that's even possible?

Well, machine learning is one field in computer science that gives us the tools to train machines to understand structures of data. That data will be fit into models that will be analyzed by structured algorithms and output specific values within a range.

The term machine learning was first introduced by gaming and AI pioneer Arthur Samuel in 1959. He developed a strategy based system for a checkers computer game that gave the foundations of what we know about machine learning.

The difference between AI and machine learning is that AI are big amounts of code with complex rules and decision trees while machine learning are algorithms that are trained in data inputs to output specific data values.

Big companies like Google, Apple, Nvidia, and Toyota have invested millions of dollars in machine learning technology. So, let me give you a wider perspective about how machine learning works and how is it applied today.

Why machine learning?

Machine learning is used today for several business models and of course, makes humanity a better place for all. Some of the most common uses are text processing, image recognition, object recognition, speech recognition, data security, financial trading, fraud detection, smart contract, and more.

Choose how to teach

There are many ways to categorized methods in machine learning but let's see four widely adopted:

Supervised learning: This method is based on the data input labeling. In this method data is labeled with the desired output, expecting to the algorithm to be “trained” from the actual output values to find errors and correct itself. This method uses patterns to predict label values on additional unlabeled data. Data can be organized by the following methods:

  • Classification: This is used to predict a categorical variable that can be defined into binary classification (two labels) and/or multi-class classification (more than two labels).
  • Regression: Predicting continuous values with a regression problem.
  • Forecasting: Predictions about the future based on past data. This is also to catch trends in the financial markets or weather conditions.

Semi-supervised learning: Here data is not completely labeled. Instead, small portions of data are labeled and “thrown” into the process of training, mixed with unlabeled data that will improve the algorithm learning accuracy.

Reinforcement learning: This method analyzes and optimizes the behavior of an agent according to the feedback of the environment.

Unsupervised learning: Unsupervised learning doesn’t use any data labeling. Data-sets are given to the algorithm for it to find hidden patterns.

  • Clustering: Grouping sets of data in one group are more, that have similar characteristics than those in other groups, finding intrinsic patterns.
  • Dimension reduction: You can reduce the number of variables under specified considerations.

Algorithms and your language

What is an algorithm?

An algorithm is a set of instructions you give to a machine to retrieve a solution to an answer you're looking for. This can be either a simple equation, e.g. 2 + 2 or more complex systems that need computational power that if done in paper will take too much time for a normal person to solve (e.g. predict weather conditions for a specific period of time having daily data from 5 to 10 years).

An algorithm receives an input (data), the computer looks at the code you gave it to (instructions), follows them in the same order you typed it, and gives back an output with the solution. When creating algorithms you should type the correct set of instructions because if not, you will receive errors..

Computer algorithms are written in different languages, e.g. C, Python, Java, JavaScript, C++, C#, R, Shell etc. Building code from scratch can be very time consuming and mentally exhausting so is better to work with languages that have their own set of libraries that you can use and benefit whenever you want to start coding. The good thing is that most of the languages already have a set of built-in libraries. What you will need to decide is, which type of language you're going to work your code with.

These are the most popular languages used for machine learning:

  1. Python
  2. C++
  3. Java
  4. JavaScript
  5. C#
  6. R
  7. Julia
  8. GO
  9. TypeScript
  10. Scala

If you want to learn more about them you can take a look at the “Best Programming Language for Machine Learning”, article. There's a small explanation for each of them.

Once you have chosen which language you will work with, you will have to learn how to use the language. Search on the web for tutorials, you'll find a lot of information for most of them. Every language has a learning curve so don't worry if you don't understand at the beginning, the important thing is to start.

Machine learning handles a lot of data, so prepare yourself for big data consumption. A small machine learning process can have at least 6,000 data sets, a big one can handle around 5,000,000 or more.

When you handle data, is very important to decide which algorithms to choose from depending on what you want to achieve. In any case, you will have to decide what type of algorithm suits your needs. There are advanced and beginner type of algorithms that will put you in a struggle if you don't know which one to choose from.

The best you can do whenever you want to start working in machine learning is to define your problem. What problems do you want to solve?

Start simple and make tests with small data-sets so you can understand your results. Then when you get the hang of it you can try something more complicated.

We won't go deep into the algorithms because that has a lot of technical information. Anyway you will have the list of them here.

The most commonly used algorithms for machine learning are:

  1. Linear Regression and Logistic Regression
  2. Linear SVM and kernel SVM
  3. Decision Trees
  4. Support Vector Machines
  5. K-Nearest Neighbors
  6. Random Forests
  7. K-Means Clustering
  8. Principal Components Analysis
  9. PCA, SVD and LDA

Check at the references and you'll find articles that give you all the information on how to understand what each algorithm does.

Going Deep

Neural Networks

When we talk about neural networks in machine learning we have to understand the concept of deep learning. Deep learning tries to imitate the brain structure of neurons and it consists of multiple layers in an artificial neural network.

The picture above is a complex deep neural network. Sharing you this image instead of a simpler one is to give you a picture of the amount of processing an algorithm will have to take care of depending on what you're trying to achieve. Notice that to achieve a neural network like the above, a significant amount of processing computational power is needed.

If you ever want to dig deep into machine learning, you will have to have big processing power to get faster results. A normal CPU can take 5 days to give a result. GPUs are heavily used in machine learning and can reduce the amount of time when you have big data-sets.

The artificial neural structure network like you can see in the first image has a lot of circles and lines in between. The first line is the entrance, input goes here. In between, the next 4 lines are called hidden layers, and the last line is the output.

Take a closer look and you'll see that every circle connects to the next circle in their right. The hidden layers are where the magic happens, where deep processing happens. In the hidden layers are where the algorithm will try to find patterns in your data. You will have to clarify what are you trying to search for. For example, if you're trying to have an image recognition pattern, you will have to assign every pixel a color with a number (input).

That input will then be multiplied by a unique weight that will later be added before getting inside the hidden layers.

Inside the hidden layers you will have specific patterns that will try to match the color and the pattern of the image with specific values. If the value is high the pattern will pass and go to the next line of the hidden layer, and will do that until it matches the final line. The function inside the hidden layers are called the threshold function or activation function. Once you get to the final line of the neural network, in the output you will have a different sets of patterns and values to match what the algorithm found. If the pattern matches what you have in the output the final result will be the solution, and in this case will be the “click”.

This was a really simple explanation of what happens. Giving you the idea of what the machine learning algorithm does was the basic concept. The goal was to explain to you how the machine “sees” the patterns. If you want to go deeper into the math of the functions and how they work, you can check the following functions, sigmoid function and/or the ReLU (Rectified Linear Unit).

The real process can go several times from input to output and from output to input again and again to find clearer patterns of the image. This process can go around several times before the process ends.

The sigmoid function is considered old school, so if you're looking to understand how deep learning works you could go directly to the ReLU function.

Conclusions

We have looked closely into what machine learning is, we have given a clear idea of what machine learning does and for what is being used. We spoke about what the machine learning algorithms are used for, training a machine, and tried to give you the clearest idea of what deep learning does.

Keep the research, below you will find several links about what machine learning is, videos, tutorials, its math, and articles that will give you in detail what this topic is about.

If you have any questions, please post them in the comment section and I'll try to give you the best answer I can. Thanks for the reading.

References

Videos:

Algorithms:

Books:

Math:

--

--

lh1008

Life just keeps on happening in the eternal present. Keep building your present.