Introduction to Machine Learning
Machine Learning: Concepts, Methods, and Real-World Challenges
1. What Machine Learning Does
Machine learning is a way of teaching computers to identify patterns in data and use those patterns to make predictions or decisions about new examples. Rather than writing a separate instruction for every possible situation, developers provide examples from which a system can learn a model—a representation of patterns in the data.
A basic machine-learning process is:
Collect examples relevant to a problem.
Use the examples to train a model to recognize patterns.
Apply the model to new data it has not encountered before.
Treat the model’s output as a prediction or guess, rather than a guaranteed fact.
For example, a model trained to distinguish cats from dogs could examine an unfamiliar image and predict which category it most resembles. Its prediction depends on patterns learned from its training examples.
Learning from examples
A person may recognize an animal using only a few clues, such as body shape, ears, or posture. A machine generally needs many examples to learn a reliable distinction. Training may require tens of thousands or even millions of examples, depending on the task and the model.
An analogy is studying for a test. Practice problems prepare a student to solve problems on an assessment. Similarly, a model is trained on examples and then evaluated on new examples. A useful assessment tests whether the model learned patterns that generalize, not merely whether it can repeat the training examples.
Categories depend on the question
A classification task asks a system to assign an example to one of the available categories. But the categories themselves may be incomplete. If a system is asked whether an image shows a cat or a dog, it may fail to represent the correct answer if the image shows a human or another animal.
This illustrates an important limitation: a model can only answer effectively within the problem it has been designed to address. Defining the categories and framing the question are part of solving the problem.
Human and machine strengths
People can often learn a new concept from only one or two examples and use judgment to adapt to unfamiliar situations. Machines are often more effective at processing extremely large collections of data—such as millions of videos—that no person could review individually.
These strengths are different:
Machines can process data at a scale and speed that would be impractical for people.
People can often generalize from few examples, question assumptions, exercise judgment, and consider goals or consequences not represented in past data.
2. Machine Learning in Everyday Applications
Machine learning is used in products that make predictions or recommendations from patterns in data. Examples include music recommendations, spam detection, and targeted advertising.
Recommendation systems
A music service may recommend a song based on features shared with music a listener already likes. Potentially useful features include:
Pitch: how high or low the sounds are.
Pacing: the speed or rhythm of the music.
Tone or sound quality: characteristics such as a filtered or unusually deep voice.
Patterns of listening: what listeners with similar histories have chosen.
Some qualities, such as a song’s “creepy” or unusual atmosphere, are easy for people to perceive but difficult to describe precisely as rules. A model may still learn relevant patterns by examining many examples, even when people have not explicitly specified every feature it uses.
Targeted advertising
Companies may use data to predict which advertisements are likely to interest a person. These predictions can seem remarkably accurate because people often behave in familiar, repeated ways. Although individuals may consider unusual events especially noteworthy, many everyday behaviors—such as eating meals or returning to the same home—are predictable in aggregate.
Systems can use previously collected information to make predictions about interests or behavior. This can create the impression that a system is reading someone’s mind, even though its predictions may be based on patterns in data already gathered.
Spam detection
An email system can use a model to predict whether a new message is spam. A developer might consider signals such as:
Words or phrases in the message.
Whether the sender and recipient have exchanged messages before.
The past classification of similar messages.
The language of the message or other recurring properties.
The choice of signals depends on the task and on what information is available. For instance, a sudden pattern of messages in a language the recipient does not normally receive might provide useful evidence.
3. Features and Feature Engineering
A feature is a measurable property of an example that may help distinguish one category or outcome from another. In spam detection, the message’s words and the sender–recipient history are possible features. In music recommendation, pitch and pacing may be features.
Feature engineering is the process of deciding which properties of the data to use and how to represent them. In traditional machine-learning approaches, people often inspect examples and make informed guesses about which features will help separate categories.
One strategy is sometimes described as a “kitchen sink” approach: try many plausible features and determine which ones are useful. This can help explore a problem, but it does not remove the need to understand the data or choose appropriate methods.
Some models can also learn useful representations or patterns directly from data, rather than relying entirely on features explicitly designed by a person. This can reduce manual feature specification, but it does not mean the model understands the problem in a human sense or that its behavior is automatically transparent.
4. Major Machine-Learning Approaches
Supervised learning
Supervised learning uses examples that already have labels. A label is the known answer associated with an example, such as “spam” or “not spam.”
The model learns which patterns are statistically associated with each label. For example, it may learn to predict whether a message is spam based on its words and sender information.
Input: examples with known labels.
Goal: learn to predict labels for new examples.
Human role: define the target categories and, in many approaches, identify useful features.
A classification task is a supervised-learning problem when the model is given labeled examples and must assign new examples to categories.
Unsupervised learning
Unsupervised learning works with data that does not have the target labels already supplied. Rather than learning to reproduce known answers, the system attempts to discover structure in the data.
A common goal is to find clusters: groups of data points that are more similar to one another than to other points. This requires a way to define or estimate similarity. In a numerical representation, an algorithm may use distance between points as part of that decision.
Input: data without the labels the system is expected to predict.
Goal: identify patterns, groups, or other structure.
Key challenge: determine what “similar” means for the data and the problem.
Supervised learning starts with categories and learns to predict them; unsupervised learning seeks structure without being given those categories in advance.
Reinforcement learning
Reinforcement learning trains a system through repeated interaction with an environment. At each decision point, the system chooses from a set of possible actions and learns from the outcomes of those actions.
A game-playing system is one example. It can play many trials, discover which actions help it succeed, and gradually improve its choices. A navigation task has a similar structure: a robot may attempt to move through a room, encounter obstacles, and learn which actions make progress toward a goal.
Decision point: the system chooses an action.
Outcome: the action changes the state of the environment.
Learning process: repeated trials help the system learn which actions are more successful.
Reinforcement learning is not simply trying arbitrary features. Its defining structure is learning through action and outcome in an environment where decisions affect what happens next.
Deep learning
Deep learning uses neural networks and often requires very large amounts of data. A network’s structure is adjusted during training so that it can make useful predictions.
Deep learning can be especially useful when data is complex and patterns are difficult to specify manually. However, it often requires substantial amounts of high-quality data, and its internal behavior can be difficult to interpret.
Deep learning and reinforcement learning describe different aspects of a system. Reinforcement learning describes a learning setup based on actions and outcomes; deep learning describes a family of models based on neural networks. They may be discussed separately, but they are not necessarily mutually exclusive.
5. Choosing an Appropriate Method
No single machine-learning method is best for every problem. Choosing an approach depends on the available data, the task, the need for explanation, and the consequences of errors.
When deep learning may be suitable
Deep learning may be appropriate when:
There is enough high-quality data to train the model.
The data is labeled usefully when labels are needed.
The task involves patterns that simpler approaches cannot capture effectively.
The developers can accept limited interpretability or invest additional work to understand the model’s behavior.
When simpler or more interpretable methods may be preferable
Some problems can be solved with linear regression or other relatively simple statistical methods. A simpler model may be preferable when it performs well and makes its reasoning easier to inspect.
A more complex model is not automatically a better solution. The goal is not simply to maximize predictive accuracy; the system must also be useful in its intended setting.
Accuracy is not the same as usefulness
A model can make accurate predictions and still fail to help anyone act. For example, a system might accurately predict which customers are likely to leave a service but provide no explanation of why they are likely to leave. If decision-makers cannot identify a cause or choose an intervention, the prediction may have little practical value.
One possible response is to keep the accurate prediction model and build an additional, interpretable system or analysis to investigate why the predictions occur. In other cases, a simpler model may offer a better balance between accuracy and explainability.
A successful machine-learning system must be useful for its intended purpose, not merely accurate on an evaluation.
6. Natural Language Processing and Model Behavior
Natural language processing (NLP) applies computational methods to human language. Tasks include analyzing the intent or audience of persuasive text, identifying persuasive techniques, and generating language.
Text can be analyzed using different kinds of representations and methods:
Lexicons: collections of words associated with particular properties or categories.
Template matching: comparing text with predefined patterns.
Automatically extracted features: patterns learned or identified from text by computational methods.
Deep learning: neural-network methods that can learn complex language patterns from large collections of text.
The choice between deep learning and more traditional techniques depends on the use case. A method that works automatically with little manual adjustment may be suitable in one setting. Another setting may require fine-grained control, interpretability, or the ability to specify exactly which properties matter.
Language models and learned distributions
A language model can be trained to predict the next sequence of words given preceding text. This objective can produce long passages that are fluent and grammatical. However, fluent language does not guarantee that a passage is accurate, appropriate, fair, or meaningful.
A model trained on text from the internet can reproduce patterns found in that text, including uncomfortable, inappropriate, or biased patterns. The model’s outputs reflect the data and training process; they should not be assumed to express sound judgment.
Language models also have generative capabilities, but generation alone does not settle questions of meaning, purpose, or value. Human interpretation and evaluation remain important.
Examining bias in language models
One way to explore patterns in a language model is to compare the words it produces in response to different prompts—for example, prompts beginning with “the woman was” and “the man was.” Differences in common continuations can offer a qualitative indication of associations in the model.
However, such a test is not a guarantee of how the model will behave in every particular situation. A limited set of prompts cannot establish the full range of a system’s behavior. Developers should be candid about what they have observed, what they have not tested, and what remains uncertain so that users can judge the risk in their own context.
7. Data Quality, Representation, and Fairness
Machine-learning systems learn from data collected in the real world. That data may reflect existing social conditions, collection practices, and biases. When a system automates decisions based on such data, it can reproduce or magnify those patterns.
Questions to ask about data
Before using data to train a system, developers need to understand:
How and why the data was collected.
Whether it represents the people and situations the system will encounter.
What information is missing or unreliable.
Which biases may have entered through collection or use.
How the data’s limitations should be documented.
The origin and context of data matter. A dataset is not just a neutral collection of measurements; its contents are shaped by decisions about what to collect, from whom, and for what purpose.
Bias can be amplified by automation
If a model uses data that reflects unfair or incomplete patterns, its predictions may carry those patterns into new decisions. Automation can make the effects broader or more consistent, particularly when the system is applied at scale.
Fairness therefore cannot be addressed solely by changing a model’s mathematics. It requires examining the full process: data collection, model design, evaluation, deployment, and the consequences of use. Societal expectations about what is fair also need to be made explicit and considered.
Transparency and reproducibility
A system is harder to trust, evaluate, or adopt when its development process cannot be understood or repeated—even by the people’s peers who created it. Good practice includes documenting the data and methods, explaining known limitations, and making the process sufficiently transparent for others to assess.
Interpretability is especially important when people need to understand why a model made a prediction or decide what action to take. A system with strong predictions but opaque behavior may create risks or fail to support responsible decisions.
8. Machine Learning in Society and Industry
Machine learning tools have become more accessible. Tasks that once required extensive, complicated code can now sometimes be carried out with a small amount of code using ready-made tools. This makes it easier for more people and organizations to experiment and build products.
Greater accessibility creates opportunities, but it does not eliminate the difficult work around the models. Successful applications also require:
Collecting and preparing appropriate data.
Building data infrastructure.
Understanding the context in which the system will be used.
Evaluating transparency, fairness, and limitations.
Planning for how people will act on the system’s output.
Some industries already apply machine learning extensively, sometimes even in settings where its use may be excessive. Other fields may have significant potential but lack the data, resources, or economic incentives needed to develop viable applications. Areas such as agriculture may offer important opportunities, but promising demonstrations do not automatically translate into practical, economically sustainable systems.
Incentives influence which problems receive attention
Machine-learning projects often focus on problems likely to produce financial returns or attract research attention. As a result, important societal problems may receive less effort, particularly when data collection is difficult or its value is not immediately apparent.
This creates a cycle: a problem receives little investment in data, the lack of data makes it harder to build a system, and the difficulty of building a system further reduces investment. Addressing such gaps may require long-term attention to data collection and infrastructure, rather than a new model alone.
Machine learning can help provide information and support better decisions, but it is not a substitute for deciding which problems matter, what outcomes are desirable, or how benefits and harms should be distributed. Those questions require human judgment and social choices.
9. Key Principles for Evaluating a Machine-Learning System
When assessing a machine-learning project, the following questions help connect the technical method to its real-world purpose:
What is the actual task? The categories, target, and intended use must be clearly defined.
What data is available? Its quality, representation, collection process, and limitations should be understood.
Which method fits the problem? Supervised, unsupervised, reinforcement, deep-learning, or simpler statistical approaches have different requirements.
What counts as success? Accuracy alone may not measure usefulness, safety, or fairness.
Can the results be interpreted? Decision-makers may need explanations to respond effectively.
What are the risks of deployment? Errors and biases may have greater consequences when decisions are automated at scale.
How will the system be documented and evaluated? Testing, transparency, and reproducibility support responsible use.
The central lesson is that machine learning combines data, models, human choices, and real-world contexts. Its potential depends not only on the ability to make predictions, but also on whether those predictions are useful, understandable, appropriately applied, and aligned with the outcomes people want.

Ask anything
We've read this whole study set, so questions about it get the best answers.