Introduction to AI
Introduction to AI
Dr. H.M.M.Caldera
Electrical and Computer Engineering
The Open University of Sri Lanka
Agenda
• A general overview and terminology
• Variables
• Feature representation
• Introduction to machine learning
• Model selection and evaluation
• Classification: kNN, decision trees, SVM
• Ensemble methods: random forests
• Regularization
A general overview and terminology
Variables
Variables = Features ??
• A"variable" is a broader term that refers to any quantity that can be
measured or controlled. It can include not only features but also
other types of data, such as labels or target variables in supervised
learning.
• "Features" specifically refer to the input variables or attributes that
are used to describe the data in a machine learning model. These
features are the characteristics or properties of the data that the
model uses to make predictions or classifications.
Introduction to machine learning
Machine Learning
Machine Learning is a subfield of Artificial Intelligence
(AI) that empowers computers to learn from data and improve
their performance over time, all without explicit programming.
detailed 4. Image Data: Image data includes images that are used for tasks
like image recognition, object detection, and facial recognition.
Convolutional Neural Networks (CNNs) are used to process this
type of data.
5. Audio Data: Audio data includes audio files that are used for
tasks like speech recognition and audio classification. Recurrent
Neural Networks (RNNs) are used to process this type of data.
6. Time-Series Data: Time-series data includes data that is
collected over time, like stock prices, weather data, and sensor
data. Time-series analysis is used to process this type of data.
ML process
• ML process has a step-by-step process.
A set of data
that use to train
the algorithm
Can be labelled
or not
Types of Machine Learning
Supervised Learning
ML
Reinforcement Unsupervised
Learning Learning
Supervised Learning
• Under supervised learning, the algorithm is trained on a labeled
dataset, which means that the input data is paired with
corresponding output labels.
• i.e. Learn to predict target values from labelled data
• The goal is for the model to learn the mapping between inputs
and outputs, making predictions or classifications on new,
unseen data.
• Common tasks include regression (predicting a continuous
value) and classification (assigning a label to input data).
• Examples of supervised learning algorithms include linear
regression, support
More - What is Supervised vector
Learning? | IBM machines, decision trees, and neural
networks.
Unsupervised Learning
• Unsupervised learning involves working with unlabeled data,
where the algorithm must discover patterns, relationships, or
structures within the data without explicit guidance.
• Clustering and dimensionality reduction are common tasks in
unsupervised learning.
• Examples of unsupervised learning algorithms include k-means
clustering, hierarchical clustering, principal component analysis
(PCA), and autoencoders.
Reinforcement Learning
• Reinforcement learning focuses on training models to make
sequential decisions by interacting with an environment. The
model receives feedback in the form of rewards or penalties
based on its actions, allowing it to learn optimal strategies over
time.
• Reinforcement learning is often used in scenarios where an
agent must learn to navigate an environment and take actions
to maximize cumulative rewards.
• Examples of reinforcement learning algorithms include
Q-learning, deep Q-networks (DQN), and policy gradient
methods.
ML Algorithms
Reinforcement
Supervised Unsupervised
learning
Regression Classification
Simple Linear
regression
Multiple Linear
regression
Polynomial
Model selection and evaluation
Supervised learning algorithms
• Linear regression
• Logistic regression
• Support vector machines
• K-NN
• Naïve bias
• Decision tree
• Random forest
Unsupervised learning algorithms
K means clustering
Hierarchical clustering
Principle Component Analysis
Independent Component Analysis
Singular Value decomposition
Supervised
learning
Regression Classification
Regression problem
Multiple
Single explanatory
explanatory
variable.(simple
variables. (multiple
linear regression)
linear regression)
Classification
Image credit -Interactive Regression Lens for Exploring Scatter Plots (researchgate.net)
Outliers
Regularization
• Regularization is a technique used in machine learning and artificial
intelligence to prevent overfitting and improve the generalization of a
model. Overfitting occurs when a model learns the training data too
well, including its noise and outliers, to the extent that it performs
poorly on new, unseen data.
• Regularization methods add a penalty term to the model's objective
function, discouraging it from fitting the training data too closely and
promoting a simpler, more generalized solution. The regularization
term is typically based on the model's parameters, and it penalizes
large parameter values.
Types of regularization
• L1 Regularization (Lasso): In L1 regularization, the penalty term is the
absolute values of the model's coefficients multiplied by a
regularization parameter. This type of regularization can lead to some
coefficients being exactly zero, effectively performing feature
selection by eliminating less important features.
• L2 Regularization (Ridge): L2 regularization adds a penalty term that
is the squared sum of the model's coefficients multiplied by a
regularization parameter. It tends to shrink the coefficients toward
zero but rarely results in exactly zero coefficients. L2 regularization is
useful for preventing large weights that may cause numerical
instability.
Learn More…
• Course | 6.036 | MIT Open Learning Library
• https://machinelearningmastery.com/start-here/#python
Questions
Thank you