An Introduction to Machine Learning

Ariel Liu
DataSeries
Published in
6 min readSep 16, 2019

Meet Pudding, my extremely lazy cat…

When you saw that photo of him, your brain was able to immediately recognize the photo to be of a cat. While your brain’s image recognition abilities are something we often take for granted, it requires a complex combination of factors to achieve.

The whole reason I’m talking about image recognition and cat pictures is to explain, (spoiler alert) how machine learning approaches this very same problem.

What is AI

Artificial intelligence (AI) is growing at an astonishing rate of acceleration, and being adopted by companies of all industries.

AI is becoming quite a buzzword and with today’s media, you’d be hard-pressed to not have heard of AI. Yet you might be surprised to know the term was coined by John McCarthy in 1956. It was only until recently when the amount of data generated grew alongside reasonable powerful processing power did AI experience an exponential boom.

Seriously, IBM stated that 90% of the data in the world today has been created in the last two years alone. Just imagine what we can accomplish with even more data in the future!

So what exactly is AI?

Artificial intelligence is an umbrella term with many variants of its definition. At the core, it focuses on gaining human-like intelligence. This can include learning from experience, and based on this data adjust to new inputs and execute tasks.

Subsets of AI ~ Machine Learning

Along with Artificial intelligence, we also hear another term being thrown around a lot, Machine Learning. Machine learning (ML) is one of the most important subsets of AI (think Russian dolls nested within each other). ML focuses on enabling programs to learn on their own, in other words using a collection of data to train itself to make better judgments. Arthur Samuel a pioneer in the field of ML described machine learning as:

“Field of study that gives computers the ability to learn without being explicitly programmed” Arthur Samuel 1959.

Subsets of Machine Learning

There are many different ways ML algorithms can learn (although I wouldn’t suggest applying these methods for SAT)…

  1. Supervised Learning
  2. Unsupervised Learning
  3. Reinforced Learning
Image Source: http://www.cognub.com/index.php/cognitive-platform/

Supervised Learning

Imagine trying to explicitly program something that can accurately classify cats vs dogs. This gets complicated and obscure as dogs and cats have many overlapping traits. Instead, you can use supervised learning, you give the program a set of data that is already associated with the correct labels. In this case, a bunch of pictures of cats and dogs all labeled “cat” or “dog”. The machine attempts to learn the relationship between the pictures and the species. The program will assess the quality of its solution and fix the function accordingly. Data is split into two portions, one larger portion for training data (training the data with labels) and one smaller portion for test data (testing the data without labels).

Supervised learning has two tasks…

Regression: understanding and predicting values

Classification: classify and label the data

Regression tries to predict a target variable based on numerical data. If you were trying to predict a cat’s weight, you can use other attributes or features of the cat in the test data to figure out the relationship between the values. The features of the cat are used to conclude what the label or output should be.

Classification tries to predict a target label, using a classification model built from training data. Similar concept to Facebook’s face tagging function where you’re directly labeling data for the algorithm, that later gives you tag suggestions.

Problems of Supervised Learning

Overfitting happens when the machine learns the training data too well, that the program no longer properly represents patterns in the real world. In other words, there is too much emphasis on getting the function perfect that it’s not adapted for new data. If an item of data the supervised learning algorithm has never seen before come along, it won’t know what to label it.

Image Source: https://datafloq.com/read/machine-learning-explained-understanding-learning/4478

__________

Unsupervised Learning

Unsupervised Learning is when the data provided is unlabeled, and the machine has to sort the data along with classifying new data.

The algorithm does this by looking at which bits of data have similar traits and clustering them together. When a new item arrives by looking at how similar it is to each cluster you can now classify this new item. Keras is a classic example of unsupervised learning.

Problems with Unsupervised Learning

Without a label, it’s hard to evaluate if the solution is truly correct. Although, the data may look sorted from one perspective if you evaluate the data from a different angle you might find it a tangled ball of yarn. With unsupervised algorithms, they only truly work if you specify the number of clusters (how many groups to divide the data into).

Image Source: https://datafloq.com/read/machine-learning-explained-understanding-learning/4478

__________

Reinforced Learning

Reinforcement learning is a little bit closer to real life, you don’t have an answer key anymore but you still have a goal or reward you’re aiming for. With no training data, the program creates its data from its experiences. By going through a period of trial and error, the program learns which actions to do to get closer to the reward and which ones not to perform. (Similar to how my cat optimizes his “I’m hungry” dance, with the appropriate amount of meows and head rubs to gain the maximum amount of tuna.)

Applications of Reinforced Learning

When DeepMind created an algorithm that could play Atari Breakout, they also used reinforcement learning. They took the pixels or current state/frame of the game as an input and had the expected reward as output. Reinforcement learning is best used for games where the reward is clear but not so much the steps to arrive there, this setup is what allowed AlphaGo to beat the previous Go champion.

A New System: Neural Networks and Deep Learning

Neural networks are composed of a network of nodes mimicked after our brain’s neurons. This network of layers of nodes intertwined in webs become better approximators of information and lead to an increase in accuracy.

Neural Networks are composed of three layers…

Image Source: https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Colored_neural_network.svg/1200px-Colored_neural_network.svg.png
  1. Input Layer
  2. Hidden Layer
  3. Output Layer

Input Layer is the layer takes the input data and directs it into the neural network.

Hidden Layer is the layer that performs the bulk of the calculations. After receiving the data from the input nodes they multiply it by a value called weight and add a bias. The whole network relies on adjusting weights and biases to generate the most accurate output possible.

Output Layer is the last layer and it evaluates the information to decide on the output or result.

Overall, this entire process of running the information through the separate layers with nodes activating other nodes is known as forward propagation.

Try a cool example of neural networks!

Key Takeaways

  1. AI refers to machines gaining human-like intelligence
  2. Machine learning is a subset of AI that focuses on having a program teach itself, instead of being explicitly programmed
  3. There are three main ways machine learning algorithms learn:
  4. Supervised Learning ~ trains with labeled data to find connections
  5. Unsupervised Learning ~ trains with unlabeled data, clusters data into groups
  6. Reinforced Learning ~ trains with a clear reward in mind
  7. Neural Networks is a computer system modeled after the brain, that determines it’s final output through layers of complex calculations

See that icon below, the one with the clap sign? Try clicking on it, go on try it! Confetti, cool right? If you want to read more cat analogies in the future or like the confetti, give my account a follow!

--

--

Ariel Liu
DataSeries

A machine learning enthusiast who’s always learning~