Dark logo

How Machines Learn

Published August 8, 2021
Doug Rose
Author | Agility | Artificial Intelligence | Data Ethics

In a previous article What Is Machine Learning? I present a brief history of machine learning and discuss how machine learning developed as a way to overcome certain limitations in the early days of artificial intelligence. Without the ability to learn, early developers could make machines do only what they were told or programmed to do. Machine learning expands their capabilities beyond what they are merely programmed to do.

When people first encounter the concept of machine learning, they often wonder how machines learn? We are accustomed to working with software that is written to program machines to interact with humans via keyboard, mouse, display screen, microphone, and speakers. We may have even noticed some mock forms of machine learning, such as programs that rearrange menu options based on the frequency with which the user chooses certain commands. However, learning how to distinguish between objects and adapt to one's environment involves complexity of another scale entirely, which makes people wonder, "How can machines possibly do that?"

The Essential Ingredients

Programming involves writing code that tells a machine, in a digital language, how to perform specific tasks. All you need is a machine that understands the programming language and instructions (software) written in that language. Machine learning requires a more complex combination of ingredients:

  • Learner: The machine equipped with an artificial neural network — a computing system made up of a number of simple but highly interconnected processing units made to function in a way similar to a biological brain.
  • Data: Input for educating/training the machine and (after the machine learns to perform a task) for providing the machine with a question to answer or problem to solve.
  • Algorithm: A mathematical formula that receives and analyzes input data to predict outputs within an acceptable range.
  • Hyperparameters: The conditions or boundaries, defined by a human, within which the machine learning is to take place. This includes the choice of machine learning algorithm, the number of neurons and arrangement of neurons that comprise the neural network, and specifics on how the neural network will tune the connections between neurons.
  • Parameters: Conditions that the machine adjusts during the learning process, in response to the data, to control the operation of the algorithms and the strength of the connections between neurons.
  • Model: An algorithm with parameters that tells the machine how to process and interpret input data. Think of the model as the product of the machine learning. The machine follows the model to interpret new data inputs.

Stepping Through the Machine Learning Process

The machine learning process is complicated and varies considerably based on the task and the type of learning (supervised or unsupervised), but it generally follows these steps:

1. A human participant sets the hyperparameters, which involves deciding on the number and arrangement of artificial neurons, choosing a machine learning algorithm, and so on.

2. The human participant feeds the machine input data. The data type varies depending on whether the machine is engaging in supervised or unsupervised learning:

  • For supervised learning, the data is in the form of input-output pairs, which are comparable to questions and answers. This trains the machine to associate the correct answer to each question.
  • For unsupervised learning, a larger volume of data is fed into the machine without any indication of what is the "correct" answer. It is up to the machine to figure that out.

3. Using the algorithm, the machine performs calculations on the inputs, adjusting the parameters as necessary:

  • For supervised learning, the parameters are adjusted to produce the outputs associated with the given inputs.
  • For unsupervised learning, the parameters are adjusted to identify shared patterns among inputs and group those inputs accordingly.

4. As it processes the inputs (or input-output pairs), the machine creates a model that consists of the algorithm and parameters required to calculate outputs based on the given inputs (supervised learning) or figure out which group an input belongs to (unsupervised learning).

5. When you feed the machine inputs, it has learned how to process those inputs to deliver the correct (or most likely to be correct) outputs.

Learning does not necessarily stop at Step 5. It may continue for as long as the model is in use, fine-tuning itself to produce more accurate outputs. For example, if you have a model that distinguishes spam from not-spam, every time a user moves a message from the Spam folder to the Inbox or vice versa, the machine adjusts the model in response to the correction.

A Simple Example

Suppose you have the following input-output pairs showing a direct correlation between the size of houses and their prices:

1,000 square feet = $50,000

1,500 square feet = $75,000

2,000 square feet = $100,000

2,500 square feet = $125,000

If you were to graph these values, you'd get a straight line, and this line could be described using the linear equation (algorithm) y = mx + b, where x is square footage (input), y is price (output), m is the slope of the line and b is the point at which the line crosses the y axis. In this algorithm, m and b are the parameters. Given the inputs and outputs, the slope of the line (m) is 1 and the line crosses the y-axis at 0 (zero). So the machine's initial model would be y = 1x + 0.

 Now suppose the machine were fed an input-output pair of 3,000 square feet = $175,000. If you were to plot that point on the graph, you would see that it is not on the line, so the machine's model is not 100% accurate.

To fix the model, the machine can adjust one or both parameters. It can change the slope of the line (m) or the y-intercept (b) or change both. That's how the machine "learns" with supervised learning.

Related Posts
August 8, 2021
Choosing the Right Machine Learning Algorithm

Choosing the right machine learning algorithm is one of the greatest challenges facing your data science team.

Read More
August 8, 2021
The Different Ways Machines Learn

In AI machines learn by looking through your data using machine learning algorithms.

Read More
February 12, 2018
The Symbolic Systems Approach

The symbolic systems approach is one of the original approaches to artificial intelligence. Symbolic AI is rule-based approach that has become less popular than machine learning.

Read More
1 2 3 13
9450 SW Gemini Drive #32865
Beaverton, Oregon, 97008-7105
Dark logo
© 2022 Doug Enterprises, LLC All Rights Reserved
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram