Machine Learning for My Grandma

Derek Kwok
8 min readMay 26, 2018

--

Have you ever used Siri? How about Alexa? Or maybe you have used an automated voice system when calling customer service at a specific company. Machine learning is all around us, yet, the shear complexity and conceptual side of the discipline is often taken for granted.

Recently, Google unveiled a new feature of Google Assistant which was capable of placing and setting appointments on your behalf. The CEO Sundar Pichai showed two demos, one for a hairdresser appointment and one for a restaurant and in both cases, the speech produced by the program was so realistic that the receiving end of the phone call did not even know they were talking to a program. It seems like the world is headed into the age of smart computer programs, and machine learning is at the forefront of it all. Having a basic understanding of this discipline will help in understanding the core of some of the cool and interesting technology that will be developed in the next few decades.

The goal of this post is to explain machine learning at a very high level so that even my grandma can understand it.

Machine Learning vs. Artificial Intelligence

Artificial intelligence may sound like a sci-fi term, but in reality, it is already used fairly extensively and covers many areas of our world today. Artificial intelligence is the concept of programs or technology that can perceive their surroundings, identify patterns, and make decisions based on these data. If we think about voice recognition software that is present on some companies’ telephone systems, these software programs take in the input of a human voice, identify patterns in tone, speech, sound, and syllables, and then interpret this data to make decisions on what to say next and what options to give the customer.

Many subjects serve as prerequisites to artificial intelligence such as linear algebra, probability and statistics, and even neuroscience; together, all of these subjects applied to technology and computer science encompasses a broad set of fields including image recognition, facial recognition, robotics, language processing, weather forecasting, stock market prediction, and many others.

Machine learning itself is a subset of artificial intelligence which involves enabling a computer program to learn by itself by providing it algorithms (a sequence of steps to accomplish a certain task) and input data so that patterns can be observed in the data provided and models can be created to explain the occurrences that it notices to predict future occurrences without being programmed explicitly. In other words, the main goal of machine learning is to generalize observations to successfully predict data that is unlabeled and that the machine has never seen before. For example, imagine we wanted to distinguish between pictures of boys and girls. The user would have many pictures of boys and girls and would feed this data into the program, and after running through all of this data, the program would be able to identify with reasonable accuracy whether a random picture that it has never seen before is of a boy or a girl. In other words, a program is said to have learned from some set of data if its ability to correctly interpret certain things, as measured quantitatively, improves with increased exposure to this data.

Fundamentals of Machine Learning

In the field of machine learning, there are generally three methods that are often employed:

  1. Supervised learning
  2. Unsupervised learning
  3. Reinforcement learning

There are also methods of learning that are inspired by the brain in the form of computer neural networks. The broad name for this particular method is deep learning.

As a general introduction to the basic concepts of machine learning, these will be explained briefly to a high level.

Supervised Learning

Let’s say you wanted to find a relationship between the number of years someone smoked and their average lifespan. A good way of doing this is to look at a large set of historical data, plot it on a set of axes, fit a data model to it, and then use this model to predict future occurrences.

This is precisely how supervised learning works at a high level. The user provides the program what is known as a “training set” of data. This data is labeled so that the program knows what the true output/answers are. The computer uses this known data to generate a model and then uses that model to predict new data that is not labeled. In the example above, data of the years smoked is provided with the average lifespan so that for each person, the computer knows how long they smoked and how long they lived so it can eventually predict how long a random person will live given that they smoked a certain number of years.

Supervised learning does two general tasks:

  1. Regression — fitting a line to a data set to predict some continuous numerical value — like the example with years smoked and average life span
  2. Classification — assigning a label to data — is it a cartoon or is it real?

In finding models for data, it often becomes beneficial to choose parameters that decrease the amount of error that is generated when the program predicts things based on data that it has never seen before. That is the primary goal of improved supervised learning.

Unsupervised Learning

Now let’s say you had a bunch of data on customers including their age, years in school, gender, and all of the purchases they made at your store the past year. Let’s say you wanted to find out if there were any unexpected trends in these data.

Unsupervised learning could be employed here as the machine learning algorithm is tasked with discovering new trends and observations from an unlabeled “training set” rather than a labeled training set. By doing this, it finds similarities and patterns in this training set to draw previously unknown relationships/correlations between variables or even to summarize the data in a useful and efficient way. What this means is that, if the correlations are strong enough, an unsupervised learning algorithm might be capable of discovering that males between the ages of 20 to 25 might be more inclined to purchase certain items or that females with a certain number of years in school purchase similar things as males of a certain age. Previously unknown trends that one would not be able to conclude or sift through in large data sets can be studied and learned using unsupervised learning.

Like in supervised learning, there are two general tasks for unsupervised learning:

  1. Clustering — grouping data into groups by similarity whereby points in one cluster are similar, but different clusters are dissimilar — might be useful for companies to understand their current customer base and how to effectively direct advertisement campaigns towards specific demographics based on these data.
  2. Dimensionality Reduction — compressing or reducing the size of data while maintaining its primary functions — compressing an image to take less space, but still display its graphic clearly

Reinforcement Learning

Imagine teaching a computer to play chess. The computer basically learns what moves are good and what moves are bad based off of the experience of winning and losing and how often certain moves resulted in wins over losses. Eventually, through exploration, the computer program learns to make moves that are more likely to maximize the chances of winning the game.

As opposed to supervised learning, reinforcement learning is all about learning without training data through experience and trial-and-error to maximize reward. In a way, this is sort of how humans learned what was safe to touch and what was dangerous to touch. We are born not knowing the difference between hot and cold and what objects are okay to touch and which ones are not. By trial-and-error and perhaps having experiences touching extremely hot or cold things, we developed an intuition on what was ok to touch due to the discomfort we felt touching a hot kettle or having fingers go numb touching snow for extended periods of time.

Computers can learn in this way too via exploration. When they realize there are short term rewards, they might exploit these short term rewards based off of the limited amount of data that they know until they accidentally stumble across a path to a larger reward. In the end, they know so much and are more likely to take actions that lead right to the largest long-term reward.

Deep Learning

Imagine trying to get a computer program to take handwritten text and convert it into computer type. Or what about having a computer translate speech….IN REAL TIME. Some problems are so complicated to solve with traditional methods that computer scientists had to draw inspiration from our own brains and in the field of neuroscience.

Deep learning at a very high level, employs the use of neural networks and training a neural network to detect an object or attribute from the natural world. These neural networks consisted of sets of virtual neurons that are assigned numerical values, biases, and connections between them. The numerical values and biases given to these neurons determine how they respond to certain stimuli (ie inputs) and certain combinations of “fired” neurons lead to connections and combinations in another set, which ultimately trickle down to a final detection after numerous adjustment cycles.

In recent years, computer scientists have figured out efficient ways to teach layers of neurons — the first layer would learn the tiniest features and each subsequent layer would recognize and learn progressively larger features and units until the whole unit was identified. Due to the fact that some networks contain thousands or even millions of neurons with millions of connections each, these structures are capable of processing some of the most advanced and complicated data sets out there. A lot of the artificial intelligence of the future will heavily employ these virtual neural networks.

--

--

Derek Kwok

BS in Materials Engineering from the University of Illinois. Software Engineering Student at Holberton School. Foreign language enthusiast. Musician. Engineer.