Introduction to Machine
Learning (CoSc4114)
Chapter 1: Introduction
Outlines
• What is Machine learning?
• Principles of ML
• Key components of ML
• Types of ML
• ML life cycle
• Applications of machine learning
March 26, 2025 2
Introduction to Machine Learning(1)
Nowadays, many industries have been dealing
with very large data sets of different types
Continuous generation of data from sensors
Manually processing all that information is costly
(time-consuming and might not even add value in
the long term).
Many strategies, from simple automation to
machine learning techniques, are being applied for a
better return on investment
March 26, 2025 3
Introduction to Machine Learning(2)
Machine Learning: A scientific discipline focused on creating algorithms
that enable computers to learn from data, adapt to, and make predictions or
decisions based on data.
Key Characteristics
Learning from Data: ML systems improve through experience gained from data inputs.
Generalization: The ability to apply learned patterns to new, unseen data
Adaptability: ML algorithms can modify their performance based on changes in the data or
environment.
March 26, 2025 4
Introduction to Machine Learning (3)
• Machine Learning: Branch of Artificial Intelligence (AI) focused on
enabling systems to learn from data, uncover patterns, and autonomously
make decisions.
• Learning from data: Systems learn from data input, detect patterns, and
make decisions or predictions.
It allows systems to evolve and improve their performance over time
without explicit programming
• Impact: ML is transforming industries from healthcare to finance
It provides powerful tools for predictive analytics, automation, and
informed decision-making.
• Data driven
In the data-driven era, ML enables better decision-making and
improved processes
• Importance:
Machine learning is important as it can help humans to solve problems that
are difficult or impossible to solve using traditional methods.
March 26, 2025 5
Introduction to Machine Learning (4)
Machine Learning is making the computer learn
from sample data and statistics.
Machine Learning is a program that analyses data
and learns to predict the outcome
Machine learning model is said to learn
From experience E
To some class of tasks T
Performance measure P
If its performance at tasks in T, as measured by
P, improves with the experience E
Experience E: Training data,
Task: Classification, clustering, forecasting
Performance P: Performance measures (Accuracy, Precisions, recall, F-Measure)
March 26, 2025 6
Introduction to Machine Learning (5)
March 26, 2025 7
Principles of Machine Learning?
• Premises: Machine learning algorithms operate under the premise that
methods that have been successful in the past will be effective in the
future
• Challenges of Machine Learning
Lack of Quality Data
Lack of high-quality data is the main issue facing machine
learning
While improving algorithms majority of developers’ time in AI,
it is crucial that the data is of high quality
Addressing this challenge requires access to extensive, high-
quality datasets.
High quality datasets in large quantities is the basis
for successful machine learning models.
• Types of datasets for ML:
Visual data - graphics, photos and videos: (E.g.: Computer vision)
Audio data - voice and speech recordings: (E.g: Speech recognition)
Textual data - linguistically relevant characters, words, sentences
2025 Numerical
March 26, data - numbers and measurements 8
Principles of Machine Learning?
March 26, 2025 9
Machine Learning Key Components(1)
• Data: cornerstone of machine learning, data is
the information processed by algorithms to
discover patterns and make predictions.
– Types of Data
•Structured Data: Organized and easily
searchable (e.g., databases, spreadsheets)
•Unstructured Data: Lacks structure, harder
to analyze (e.g., text, images, audio)
•Semi-Structured Data: Partially organized
(e.g., JSON, XML).
March 26, 2025 10
Machine Learning Key Components (2)
• Model:
– A mathematical representation that captures
patterns in training data to make predictions on
new, unseen data.
– Model Training:
•Feeding it data and adjusting its parameters
to minimize prediction errors.
•This typically requires a training dataset,
validation dataset, and testing dataset to
evaluate model performance.
March 26, 2025 11
Types of Machine Learning:
1. Supervised Learning
• Models learn from labeled data to
predict outcomes
• Examples: Classification, Regression.
2. Unsupervised Learning
• Models find patterns in unlabeled data.
• Examples: Clustering, Dimensionality Reduction.
3. Reinforcement Learning
• Models learn through trial and error,
receiving feedback in the form of
rewards or penalties.
• Examples: Game playing, Robotics
March 26, 2025 12
Types of Machine Learning:
March 26, 2025 13
Types of Machine Learning:
1. Supervised Learning
Model is trained on a labeled dataset.
Each data point in the training set consists of an input
and the corresponding correct output (label)
The goal of the model is to learn the mapping between
inputs and outputs so that it can accurately predict
outputs for new, unseen data.
Classification
The model predicts a categorical label (e.g., spam vs. not
spam).
Example: The model classifies inputs into
predefined categories based on the data it
has learned from
Regression
The model predicts continuous numerical values.
Example, it might estimate housing prices
based on features like square footage, number
of bedrooms, and
March 26, 2025
location
14
Types of Machine Learning:
2. Unsupervised Learning
model is trained on data that has no labels
The goal is to uncover hidden patterns, relationships, or
structures within the data without predefined output labels
Unlabeled Data: The data used does not come with predefined
labels or categories. For example, a dataset of customer
purchase histories could be analyzed without knowing any prior
groupings of customers
Clustering algorithm:
Involves grouping similar data points based on their features.
Algorithms such as K-means and hierarchical clustering
are commonly used
Example: Customers with similar purchasing behavior can be
grouped together to identify different customer segments
March 26, 2025 15
Types of Machine Learning
3. Reinforcement Learning
Machine learning paradigm where an agent learns to
make decisions by interacting with an environment,
receiving feedback through rewards or penalties based
on its actions
Key Components:
Agent: The decision-maker (e.g., a robot)
Environment: The external system with which the
agent interacts (e.g., the agricultural field)
Rewards: Feedback signals that indicate the success or
failure of the agent's actions (e.g., achieving a goal or
encountering an obstacle).
Applications: Game-playing, robotic control, and self-
driving cars, where the system learns strategies and
optimizes its performance
March 26, 2025 16
Machine Learning life cycle
March 26, 2025 17
Machine Learning life cycle
1. Gathering Data
Collect relevant data from various sources, ensuring it aligns with
the problem to be solved.
Sources of Data: Internal databases, APIs, web scraping,
surveys
Importance: High-quality, relevant data is crucial for
effective model training.
2. Data Preparation
Clean and preprocess the gathered data to make it suitable for analysis
This includes handling missing values, normalizing data, and
converting data types.
3. Data wrangling
Transform and manipulate the data into a format that is more suitable
for analysis, which may involve merging datasets, filtering out
irrelevant information, or reshaping the data.
March 26, 2025 18
Machine Learning life cycle
4. Data Analysis:
Explore and analyze the data to identify patterns, trends, and
relationships. This can include statistical analysis and
visualization techniques
5. Train a Model:
Use the prepared dataset to train a machine learning model. This
involves selecting an appropriate algorithm and fitting the model to
the training data.
6. Test a Model:
Evaluate the trained model's performance using a separate test
dataset to ensure it generalizes well to unseen data. Metrics like
accuracy, precision, recall, and F1-score are typically used.
7. Deployment
Deploy the model into a production environment where it can be
used to make predictions or decisions in real time. This may involve
integrating the model into an application or system for end users.
March 26, 2025 19
Machine Learning: Eager Learners Vs. Lazy Learners
1. Eager learners
Learning algorithms that first build a model from the
training dataset before making any prediction on future
datasets
They spend more time during the training process because
of their eagerness to have a better generalization during the
training from learning the weights, but they require less
time to make predictions
Most machine learning algorithms are eager learners
Examples
Logistic Regression
Support Vector Machine
Decision Trees
Artificial Neural Networks.
March 26, 2025 20
Machine Learning: Eager Learners Vs. Lazy Learners
2. Lazy learners (instance-based learners):
They don’t create model immediately from the training
data, and this is where the lazy aspect comes from
They work by memorizing the training data, and each time
there is a need to make a prediction, the model searches
for the nearest neighbor from the whole training data, that
makes such models slow during prediction.
•Example:
– K-Nearest Neighbor.
» Pros: High accuracy, insensitive to outliers, no
assumptions about data
» Cons: Computationally expensive, requires a lot of
memory
» Works with: Numeric values, nominal values
March 26, 2025 21
Applications of Machine Learning
Speech Recognition: Converts spoken language to
text
for voice assistants (e.g., Siri, Google Assistant).
Object Detection: Identifies and locates
objects in images/videos, crucial for self-
driving cars.
Medical Diagnostics: Analyzes medical data to
assist in disease diagnosis and treatment
personalization.
Recommendation Systems: Provides
personalized suggestions based on user
behavior (e.g., Netflix, Amazon)
Finance: Used for fraud detection, algorithmic
trading, and risk assessment.
March 26, 2025 22
Natural Language Processing (NLP): Powers
tasks such as sentiment analysis, chatbots,
and translation (e.g., Google Translate).
March 26, 2025 23
Applications of Machine Learning
March 26, 2025 24