How Machines Learn

How Machines Learn

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

Article content

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

Article content

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.

Frequently Asked Questions

What is machine learning, and how does it relate to AI?

Machine learning is like a subdivision of artificial intelligence (AI). It involves training algorithms to make predictions or decisions based on data.

These computer programs use data to see patterns. They make predictions based on what they learn. This helps computers learn on their own without being programmed. 

How does machine learning works?

Machine learning algorithms work by analyzing training data to identify patterns and relationships.

These algorithms can be classified into supervised learning, where they learn from labeled data, and unsupervised learning, where they identify patterns in unlabeled data.

How can I get started with machine learning?

To get started with machine learning, you can begin by learning the basics of programming, particularly in languages like Python.

Then, you can study concepts of data science and machine learning, including supervised and unsupervised learning. Utilizing online resources, tutorials, and enrolling in courses can also be beneficial.

What are the different forms of machine learning?

The primary forms of machine learning are supervised machine learning, unsupervised machine learning, semi-supervised learning, and reinforcement learning. 

Each form has its specific methods and use cases, such as making predictions using labeled data in supervised learning or optimizing actions based on feedback in reinforcement learning.

How do you use machine learning algorithm in real-world applications?

Machine learning is used in various real-world applications, including self-driving cars, recommendation systems, fraud detection, and language models.

It enables businesses to make data-driven decisions and create systems that can adapt and improve over time.

Article content

This is my weekly newsletter that I call The Deep End because I want to go deeper than results you’ll see from searches or LLMs. Each week I’ll go deep to explain a topic that’s relevant to people who work with technology. I’ll be posting about artificial intelligence, data science, and ethics.

This newsletter is 100% human written 💪 (* aside from a quick run through grammar and spell check).

more sources

  1. https://en.wikipedia.org/wiki/Machine_learning
  2. https://www.techtarget.com/whatis/A-Timeline-of-Machine-Learning-History
  3. https://www.dataversity.net/a-brief-history-of-machine-learning/
  4. https://www.clickworker.com/customer-blog/history-of-machine-learning/
  5. https://www.akkio.com/post/history-of-machine-learning
  6. https://www.sagemotion.com/blog/machine-learning-what-are-key-ingredients
  7. https://lakefs.io/blog/machine-learning-components/
  8. https://towardsdatascience.com/the-ingredients-of-machine-learning-algorithms-4d1ca9f5ceec?gi=68bfa48d9bc5
  9. https://infiniticube.com/blog/6-key-elements-of-machine-learning/
  10. https://www.tecnrt.org/docs/cse/materials/ML.pdf
  11. https://www.datascience-pm.com/machine-learning-process/

Definitely worth reading, thanks for the knowledge Doug.

Rodrigo de Souza Silva

Data Analysis | Data Science | Machine Learning | Python | SQL | Statistics | Predictive Modelling | Data Engineering | Big Data | Business Intelligence | Power BI

3mo

Brilliant article, Doug! I’m currently transitioning into the data field and still solidifying my understanding of machine learning fundamentals. I particularly appreciated how clearly you broke down the key ingredients of the process. Explanations like this are incredibly helpful for those of us learning independently. Many thanks for sharing!

Gabriel Millien

I help you thrive with AI (not despite it) while making your business unstoppable | $100M+ proven results | Nestle • Pfizer • UL • Sanofi | Digital Transformation | Follow for daily insights on thriving in the AI age

3mo

Doug Rose, this is a fantastic breakdown of what actually makes machine learning learning not just programming at scale. The nuance most people miss: Traditional software follows rules we design. Machine learning finds rules from data we provide, then adapts those rules based on new information. It’s not magic. It’s structured uncertainty managed through data, models, and iteration. As AI systems become more integrated into decision-making, understanding these foundations isn’t optional anymore, especially for leaders who will be asked to trust or challenge machine-driven outputs. Knowing how a model learns gives you the ability to ask the right questions and that’s becoming a core leadership skill, not just a technical one.

To view or add a comment, sign in

Others also viewed

Explore topics