1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning Introduction

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Machine Learning Introduction

Machine Learning: Core Concepts and Applications

Why Machine Learning Matters

Machine learning is a major technological development with the potential to transform nearly every industry. The growth of machine learning is being driven by three closely related factors:

  • The increasing availability of large datasets

  • Rapid advances in learning algorithms

  • Improvements in computational power and specialized hardware

Machine learning is no longer limited to traditional technology companies. It is increasingly applied in:

  • Healthcare, including medical diagnosis and treatment support

  • Manufacturing and logistics

  • Transportation and autonomous vehicles

  • Law, including the processing of legal documents

  • Education and personalized tutoring

  • Biology and computational medicine

  • Engineering and scientific research

  • Social-network analysis and market segmentation

  • Language, literature, and historical analysis

  • Robotics and autonomous systems

The value of machine learning projects is increasing rapidly because organizations in many fields now have both the data and the computational tools needed to build useful systems. Many industries still lack enough people who understand how to apply these tools effectively, creating substantial opportunities for both research and practical innovation.

Machine learning can be used not only to build profitable products but also to address meaningful social problems. Potential applications include improving healthcare, providing individualized education, strengthening democratic institutions, improving transportation, and helping organizations make better decisions. Because machine learning systems can influence important parts of society, they should be developed and applied ethically and responsibly.


What Is Machine Learning?

Two influential definitions help explain the central idea.

Samuel’s Definition

Arthur Samuel described machine learning as:

A field of study that gives computers the ability to learn without being explicitly programmed.

Traditional programs are explicitly instructed how to produce an output from an input. In contrast, a machine learning system is given examples and uses those examples to discover useful patterns or relationships.

Samuel demonstrated this idea through a checkers-playing program. The program played many games against itself and learned which board configurations were more likely to lead to wins or losses. Eventually, it became better at checkers than its creator. The programmer had not directly specified every strategy the program should use; instead, the program learned strategic patterns from experience.

This example illustrates a central feature of machine learning: a program can perform effectively on a task in ways that were not individually written into its code.

Mitchell’s Well-Posed Learning Problem

Tom Mitchell defined a learning problem using three components:

  • Experience EEE: The data or interactions from which the system learns

  • Task TTT: The activity the system must perform

  • Performance measure PPP: The metric used to evaluate the system

A program learns from experience EEE with respect to task TTT and performance measure PPP if its performance on TTT, measured by PPP, improves with experience EEE.

For the checkers example:

  • Experience EEE: Games played against itself

  • Task TTT: Playing checkers

  • Performance measure PPP: The probability of winning future games

This formulation emphasizes that machine learning is not merely about memorizing data. The system must improve its performance on a task as it gains relevant experience.


Supervised Learning

Supervised learning is the most widely used category of machine learning. The system learns from examples that contain both:

  • An input, usually denoted by xxx

  • A correct output or label, usually denoted by yyy

The learning algorithm attempts to learn a function that maps inputs to outputs:

x↦yx \mapsto yx↦y

After learning this mapping from training examples, the system can make predictions for new inputs whose correct outputs are unknown.

In supervised learning, the training data contain both inputs and their corresponding labels. The goal is to learn a mapping that predicts the appropriate label for a new input.

Housing-Price Prediction: Regression

Suppose a dataset contains information about houses. Each example includes:

  • xxx: the size of the house in square feet

  • yyy: the price of the house

A graph can place house size on the horizontal axis and price on the vertical axis. The learning algorithm then attempts to find a relationship between the two variables.

For example, it could fit a straight line:

y^=f(x)\hat{y} = f(x)y^​=f(x)

where y^\hat{y}y^​ is the predicted price.

If a house has a known size, the fitted line can be used to estimate its price. A more flexible model, such as a quadratic function, might fit the data better:

y^=ax2+bx+c\hat{y} = ax^2 + bx + cy^​=ax2+bx+c

The choice between a straight line, a quadratic function, or another model is an important machine learning decision. Different models make different assumptions about the relationship between the input and output.

Definition of Regression

A regression problem is a supervised learning problem in which the output is continuous or approximately continuous.

Examples include predicting:

  • Housing prices

  • Temperature

  • Income

  • Demand for a product

  • Travel time

  • Energy consumption

Although some values, such as prices, are technically recorded to a finite precision, they are generally treated as continuous quantities for modeling purposes.


Tumor Diagnosis: Classification

Consider a medical dataset involving breast tumors. Each example contains:

  • xxx: a feature such as tumor size

  • yyy: whether the tumor is malignant or benign

A malignant tumor is cancerous or harmful, while a benign tumor is generally noncancerous and less harmful.

The output may be represented numerically:

  • y=1y = 1y=1: malignant

  • y=0y = 0y=0: benign

The learning algorithm uses labeled examples to learn whether a new tumor is likely to be malignant or benign.

Definition of Classification

A classification problem is a supervised learning problem in which the output takes one of a discrete set of possible values.

For binary classification, there are two possible outputs:

y∈{0,1}y \in \{0,1\}y∈{0,1}

For multiclass classification, the output may belong to one of KKK categories:

y∈{1,2,…,K}y \in \{1,2,\ldots,K\}y∈{1,2,…,K}

Examples include:

  • Benign versus malignant tumors

  • Spam versus non-spam email

  • Fraudulent versus legitimate transactions

  • Recognizing one of several objects in an image

  • Identifying the type of cancer

  • Classifying a document by topic

The key distinction is:

  • Regression: The output is continuous.

  • Classification: The output is discrete.


Input Features and High-Dimensional Data

Simple examples often use only one input feature, such as tumor size. Real machine learning systems generally use many features.

For tumor diagnosis, features might include:

  • Tumor size

  • Patient age

  • Clump thickness

  • Uniformity of cell size

  • Uniformity of cell shape

  • Cell adhesion

  • Other measurable properties of the tumor or surrounding tissue

The input can therefore be represented as a vector:

x=[x1x2⋮xn]x = \begin{bmatrix} x_1\\ x_2\\ \vdots\\ x_n \end{bmatrix}x=​x1​x2​⋮xn​​​

where each component represents one feature.

A patient represented using only tumor size has a one-dimensional input. A patient represented using tumor size and age has a two-dimensional input. A patient described by many medical measurements has a high-dimensional input.

Why High Dimensions Matter

When there are one or two features, the dataset can be plotted easily. With many features, visualization becomes difficult or impossible because humans cannot directly visualize most high-dimensional spaces.

Machine learning algorithms must therefore operate mathematically on feature vectors without relying on visual inspection. This requires methods that can:

  • Handle many input variables

  • Identify useful relationships among features

  • Separate classes in high-dimensional spaces

  • Avoid overfitting irrelevant details

  • Make predictions for new examples


Support Vector Machines and Kernels

A support vector machine is a classification algorithm that can operate effectively in high-dimensional feature spaces.

A particularly important idea is that kernel methods can implicitly work with an extremely large, even infinite-dimensional, set of features. The system does not need to explicitly store every feature as a separate number. Instead, kernel techniques compute the relationships needed by the algorithm without constructing the full feature vector directly.

This addresses an important computational problem. A computer cannot literally store an infinite list of feature values. Kernel methods avoid this by using mathematical operations that act as though the data had been transformed into an infinite-dimensional space.

The advantage of a richer feature representation is that it may provide more information with which to distinguish examples. However, high-dimensional representations must be used carefully, because overly flexible models can fit accidental patterns rather than meaningful structure.


Supervised Learning in Autonomous Driving

An autonomous-driving system provides a practical example of supervised learning.

Training Data

During training, a human drives the vehicle. At regular intervals, the system records:

  • An image from a forward-facing camera

  • The steering direction selected by the human driver

The camera image is the input xxx, and the human driver’s steering decision is the label yyy.

The training examples therefore have the form:

(x(i),y(i))(x^{(i)}, y^{(i)})(x(i),y(i))

where:

  • x(i)x^{(i)}x(i) is the image observed at time iii

  • y(i)y^{(i)}y(i) is the steering direction chosen by the human

The learning algorithm uses these examples to learn a mapping:

image in front of vehicle↦steering direction\text{image in front of vehicle} \mapsto \text{steering direction}image in front of vehicle↦steering direction

Neural-Network Learning

An artificial neural network initially produces poor steering predictions. As it trains, an optimization method such as gradient descent adjusts the network’s parameters so that its predictions become more similar to the human driver’s actions.

Backpropagation is a method used to compute how changes in neural-network parameters affect prediction error. Gradient descent then uses this information to update the parameters in a direction that reduces the error.

After training:

  1. The vehicle captures a new image.

  2. The image is passed through the trained neural network.

  3. The network predicts a steering direction.

  4. A control system turns the steering wheel accordingly.

This illustrates the difference between training and deployment:

  • Training: The system receives both images and human steering labels.

  • Deployment: The system receives only a new image and must predict the steering action.

A more advanced system may train separate models for different road situations, such as one model for a one-lane road and another for a multilane road. An additional decision mechanism can determine which model is most appropriate for the current situation.

The example demonstrates supervised learning, even though autonomous driving itself requires many additional capabilities beyond predicting steering direction.


Machine Learning as an Engineering Discipline

Learning algorithms rarely work perfectly on the first attempt. Building a successful machine learning system requires many strategic decisions.

Possible decisions include:

  • Whether to collect more training data

  • What type of data to collect

  • Whether to use a different algorithm

  • Whether to add or remove features

  • Whether to use a more complex model

  • Whether to train for longer

  • Whether to use faster hardware or graphics processors

  • How to structure the neural network

  • How to evaluate the model

  • Which errors deserve the most attention

The same algorithm can produce very different results depending on how effectively it is applied. Two teams may use the same learning method, yet one team may achieve much better performance because it makes better choices about data, modeling, evaluation, and debugging.

Systematic Debugging

Machine learning development should be treated as a systematic engineering process rather than as trial-and-error experimentation or “black magic.”

An ineffective approach is to make arbitrary changes without identifying the source of the problem. A more effective approach is to:

  1. Measure the system’s performance.

  2. Identify the most important source of error.

  3. Determine which intervention is most likely to improve performance.

  4. Run a focused experiment.

  5. Compare the new result with the previous result.

  6. Repeat the process using evidence.

This resembles software optimization. An inexperienced programmer may rewrite code everywhere in an attempt to make it faster. An experienced programmer first uses a profiler to find the bottleneck and then concentrates effort on the part of the program that consumes the most time.

Similarly, a machine learning practitioner should identify the dominant source of model error before changing the system.

Effective machine learning depends not only on knowing algorithms but also on knowing how to choose, evaluate, debug, and improve them systematically.

This perspective is sometimes called machine learning strategy or learning theory in an applied engineering context. It focuses on making good decisions efficiently when developing real systems.


Deep Learning

Deep learning is a particularly important subset of machine learning based on neural networks with multiple layers.

Deep-learning methods have advanced rapidly and have achieved strong results in areas such as:

  • Computer vision

  • Speech recognition

  • Natural language processing

  • Autonomous vehicles

  • Robotics

  • Game playing

  • Medical analysis

Deep learning is only one part of machine learning. Machine learning includes many other approaches, such as:

  • Linear and logistic regression

  • Support vector machines

  • Clustering

  • Probabilistic models

  • Reinforcement learning

  • Other statistical and optimization-based methods

Deep learning is powerful and important, but a complete machine learning education also requires understanding the broader set of algorithms and concepts.


Unsupervised Learning

In unsupervised learning, the algorithm is given inputs but not corresponding labels.

The training data contain xxx values but no yyy values. The objective is to discover interesting structure, organization, or regularity within the data.

Unsupervised learning finds patterns in data without being given explicit correct answers.

Clustering

Suppose a dataset contains points distributed into two visible groups, but no labels identify the groups. An unsupervised algorithm can discover that the examples naturally form clusters.

One common clustering method is KKK-means clustering. The algorithm attempts to divide the data into KKK groups so that examples within the same group are relatively similar.

For a dataset with two natural groups, the algorithm might use:

K=2K = 2K=2

The algorithm discovers the grouping from the input data alone. It is not told in advance which examples belong to which category.

Applications of Clustering

Clustering can be used to:

  • Group news articles covering the same event

  • Identify communities in a social network

  • Segment customers into market groups

  • Organize genetic or microarray data

  • Group galaxies or other astronomical objects

  • Organize computing clusters and related workflows

  • Discover subgroups of patients

  • Identify patterns in large collections of documents

News Clustering

A news service may collect thousands of articles from different sources. Articles describing the same event can be grouped together even if they come from different newspapers or websites.

For example, articles about the same oil-well spill may be clustered into one group. The system does not necessarily need a human to label each article as belonging to that event. Instead, it analyzes similarities in the text and discovers that the articles are related.

Customer Segmentation

A company can apply clustering to its customer database and discover groups of users with similar behavior or characteristics. These groups may represent different market segments, such as:

  • Young professionals

  • Families

  • Frequent users

  • Occasional users

  • Customers interested in a particular product category

The company can then design separate marketing or product strategies for different segments.


Unsupervised Learning Is Broader Than Clustering

Clustering is one type of unsupervised learning, but unsupervised learning includes more than clustering.

The general goal is to learn something useful from unlabeled inputs. Other examples include:

  • Discovering lower-dimensional representations

  • Separating mixed signals

  • Learning patterns in text

  • Finding hidden structure in biological data

  • Learning relationships and analogies in language

Thus:

  • Unsupervised learning: The broad category involving unlabeled data

  • Clustering: One specific unsupervised-learning task involving the discovery of groups


The Cocktail Party Problem

The cocktail party problem involves separating overlapping signals.

Imagine a room containing several people speaking at the same time. Multiple microphones record the room, and each microphone captures a mixture of all the voices.

The input consists of several mixed audio signals. The goal is to recover the individual speakers’ voices.

This is an unsupervised problem because the system is not given labeled recordings identifying which parts of the audio belong to which speaker.

A method called Independent Components Analysis, or ICA, can be used to separate the mixed signals under suitable assumptions about the sources.

The process can be described as:

  1. Multiple microphones record simultaneous sounds.

  2. Each recording contains a mixture of the speakers’ voices.

  3. The algorithm analyzes the relationships among the recordings.

  4. The algorithm estimates the independent underlying signals.

  5. The mixed recording is separated into individual voices.


Learning Language Structure Without Labels

The internet contains enormous quantities of text that are not necessarily labeled for a particular machine learning task. Unsupervised methods can use this text to discover linguistic structure.

For example, a system can learn relationships such as:

  • Man is to woman as king is to queen.

  • Tokyo is to Japan as Washington, D.C. is to the United States.

The system can infer these analogies by learning patterns in how words occur in relation to one another. No person needs to explicitly label every analogy in the training data.

This demonstrates that unsupervised learning can discover abstract relationships, not merely group similar examples.


Reinforcement Learning

Reinforcement learning is a form of machine learning in which an agent interacts with an environment and learns through rewards and penalties.

Unlike supervised learning, the system is not given the correct action for every situation. Instead, it tries actions and receives feedback about how desirable the results are.

The central objective is to choose actions that maximize long-term reward.

Helicopter Control Example

Consider an autonomous helicopter. The system must determine how to move its control inputs so that the helicopter flies safely and accurately.

There is no simple list of correct control movements for every possible situation. The optimal control strategy may be unknown, even to human experts.

A reinforcement-learning system can:

  1. Observe the helicopter’s current state.

  2. Choose control actions.

  3. Observe the resulting movement.

  4. Receive a reward or penalty.

  5. Adjust its strategy to increase future rewards.

Good flight behavior receives a positive reward. Poor behavior, such as unstable flight or crashing, receives a negative reward.

Over time, the system learns a policy: a strategy for choosing actions based on the current state.

Animal-Training Analogy

Reinforcement learning is analogous to training an animal:

  • A desired behavior receives positive feedback.

  • An undesirable behavior receives negative feedback.

  • Over time, the animal performs more rewarded behaviors and fewer punished behaviors.

The algorithm does not need to be explicitly told the ideal sequence of actions. It learns through trial, feedback, and repeated interaction.

Robotics and Locomotion

A robot may have many joints and may need to learn how to climb over obstacles. The programmer may not know the exact joint movements required.

A reinforcement-learning system can experiment with different movements and receive rewards for:

  • Moving forward

  • Remaining stable

  • Avoiding obstacles

  • Reaching a destination

  • Using less energy

  • Completing the task efficiently

The system gradually learns movements that produce higher total reward.

Game Playing

Reinforcement learning has achieved notable results in games, including:

  • Atari video games

  • The game of Go

  • Other environments in which actions produce clear rewards

Game-playing systems benefit from well-defined rules, repeated interaction, and measurable outcomes. However, reinforcement learning is also important beyond games.

Other potential applications include:

  • Robotic control

  • Autonomous vehicles

  • Logistics optimization

  • Resource allocation

  • Industrial control

  • Sequential decision-making

The most exciting applications may involve systems that must continuously make decisions in the physical world rather than merely play games.


Major Categories of Machine Learning

The major areas introduced are:

Supervised Learning

  • Uses labeled input-output pairs

  • Learns a mapping from xxx to yyy

  • Includes regression and classification

  • Examples include price prediction, tumor diagnosis, and steering prediction

Machine Learning Strategy and Learning Theory

  • Focuses on applying algorithms effectively

  • Involves evaluation, debugging, data collection, and model selection

  • Replaces arbitrary trial and error with systematic engineering

Deep Learning

  • Uses multilayer neural networks

  • Has achieved major advances in vision, speech, language, robotics, and games

  • Represents one important subset of machine learning

Unsupervised Learning

  • Uses unlabeled inputs

  • Discovers hidden structure or patterns

  • Includes clustering, signal separation, and language-structure discovery

Reinforcement Learning

  • Learns through interaction with an environment

  • Uses rewards and penalties

  • Applies to robotics, helicopter control, game playing, and sequential decisions


Relationship Among AI, Machine Learning, and Deep Learning

These terms describe nested areas:

  • Artificial intelligence is the broadest field, covering methods for building systems that perform tasks associated with intelligence.

  • Machine learning is a major subfield of artificial intelligence in which systems learn patterns or behaviors from data and experience.

  • Deep learning is a subfield of machine learning focused primarily on multilayer neural networks.

Therefore:

Deep Learning⊂Machine Learning⊂Artificial Intelligence\text{Deep Learning} \subset \text{Machine Learning} \subset \text{Artificial Intelligence}Deep Learning⊂Machine Learning⊂Artificial Intelligence

Machine learning is broader than deep learning because it includes many non-neural methods. Artificial intelligence is broader than machine learning because some AI systems use explicitly programmed rules, search, planning, or reasoning rather than learning from data.

A strong practitioner benefits from understanding multiple perspectives, including:

  • Probability and statistics

  • Linear algebra

  • Optimization

  • Machine learning

  • Deep learning

  • Reinforcement learning

  • Planning and decision-making

Together, these areas provide the mathematical and practical foundation for designing effective intelligent systems.

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent