What makes these
things possible?
Machine Learning
(AI/DL)
Course Information
Course Code: CSC354 Course Title: Machine Learning
Credit Hours: 3(3,0) Lecture Hours/Week: 3
Lab Hours/Week: 0 Pre-Requisites: None
Catalogue Description:
This course provides the overview of machine learning along with
various learning tasks.
Topics include:
Overview of Machine Learning; Supervised Learning; Unsupervised
Learning; Reinforcement Learning; and Deep Learning.
Course Contents:
Machine Learning
Arthur Samuel, a pioneer in
the field of artificial
intelligence and computer
gaming, coined the
term “Machine Learning”. He
defined machine learning as –
a “Field of study that gives
computers the capability to
learn without being explicitly
programmed”.
Artificial Intelligence
Artificial
Intelligence
The ability of a digital computer or
computer-controlled robot to perform
tasks commonly associated with
intelligent beings. AI is also defined
as,
• An Intelligent Entity Created By
humans
• Capable of Performing Tasks
intelligently without being
explicitly instructed.
• Capable of thinking and acting
rationally and humanely.
Artificial Intelligence
“An ability of a computer or machine to work the same as the human brain is called
Artificial Intelligence.”
AI means to copy the human brain in such a way that it performs exactly how a human brain
would in any particular situation by thinking and functioning just like a human. AI is still under
growth but has achieved a lot by so far, and the best example to take into the account would be the
Sophia an advancement of AI, Siri, etc. It does not need to be preprogrammed, and rather it uses
algorithms which works for its intelligence. It incorporates Reinforcement learning, deep
learning neural networks.
Deep Learning
Deep Learning
“Deep learning is a subset of machine learning used to decode
complicated issues by learning from its own methods of
computation.”
Deep learning is a machine learning technique that teaches
computers to do what comes naturally to humans: learn by
example. Deep learning is a key technology behind driverless cars,
enabling them to recognize a stop sign, or to distinguish a pedestrian
from a lamppost
AI/ML/DL
AI/ML/DL
Machine Learning (ML) is commonly used along with AI
but it is a subset of AI. ML refers to an AI system that can
self-learn based on the algorithm. Systems that get smarter
and smarter over time without human intervention is ML.
Deep Learning (DL) is a machine learning (ML) applied to
large data sets
Machine Learning
Arthur Samuel, a pioneer in
the field of artificial
intelligence and computer
gaming, coined the
term “Machine Learning”. He
defined machine learning as –
a “Field of study that gives
computers the capability to
learn without being explicitly
programmed”.
Machine Learning
Supervised Vs
Unsupervised ML
Supervised Learning
Supervised Learning
The model or algorithm is presented with example inputs and
their desired outputs and then finding patterns and connections
between the input and the output. The goal is to learn a general
rule that maps inputs to outputs. The training process continues
until the model achieves the desired level of accuracy on the
training data.
• Image Classification
• Market Prediction/Regression
• Spam Filtering
• Speech Recognition
Supervised Machine Learning
Suppose we have a dataset of different types of shapes which includes square,
rectangle, triangle, and Hexagon. Now the first step is that we need to train the model for
each shape.
•If the given shape has four sides, and all the sides are equal, then it will be labelled as
a Square.
•If the given shape has three sides, then it will be labelled as a triangle.
•If the given shape has six equal sides then it will be labelled as hexagon.
Now, after training, we test our model using the test set, and the task of the model is to
identify the shape.
The machine is already trained on all types of shapes, and when it finds a new shape, it
classifies the shape on the bases of a number of sides, and predicts the output.
Steps involved in Supervised Learning
•First Determine the type of training dataset
•Collect/Gather the labelled training data.
•Split the training dataset into training dataset, test dataset, and validation dataset.
•Determine the input features of the training dataset, which should have enough
knowledge so that the model can accurately predict the output.
•Determine the suitable algorithm for the model, such as support vector machine,
decision tree, etc.
•Execute the algorithm on the training dataset. Sometimes we need validation sets as the
control parameters, which are the subset of training datasets.
•Evaluate the accuracy of the model by providing the test set. If the model predicts the
correct output, which means our model is accurate.
Types of supervised ML Algorithms:
Classification tries to find
the decision boundary,
which divides the dataset
into different classes.
Regression algorithms solve
regression problems such as
house price predictions and
weather predictions
Regression
Regression algorithms are used if there is a relationship between the input variable and
the output variable. It is used for the prediction of continuous variables, such as Weather
forecasting, Market Trends, etc.
Linear Regression
Regression Trees
Non-Linear Regression
Bayesian Linear Regression
Polynomial Regression
Classification
Classification algorithms are used when the output variable is categorical, which means there are
two classes such as Yes-No, Male-Female, True-false, etc.
Inputs are divided into two or more classes, and the learner must produce a model that assigns
unseen inputs to one or more (multi-label classification) of these classes and predicting whether or
not something belongs to a particular class. This is typically tackled in a supervised
way. Classification models can be categorized in two groups: Binary classification and Multiclass
Classification. Spam filtering is an example of binary classification, where the inputs are email (or
other) messages and the classes are “spam” and “not spam”.
• Random Forest
• Decision Trees
• Logistic Regression
• Support vector Machines (SVM)
Regression Vs Classification
Regression Vs Classification
Regression Model
Linear Regression Model
Linear Regression Model
Cost Function
Used to estimate how
badly models are
performing. Put simply,
a cost function is a
measure of how wrong
the model is in terms of
its ability to estimate the
relationship between X
and y. This is typically
expressed as a
difference or distance
between the predicted
value and the actual
value.
Equation of a Straight Line
The equation of a
straight line is y=mx+b
y = m x + b, m is the
gradient or slope and b is
the height at which the
line crosses the y -axis,
also known as the y -
intercept.
Equation of a Straight Line
Cost Function Intuition
Cost Function Intuition (w=1)
Cost Function Intuition (w=0.5)
Cost Function Intuition (w=0)
Cost Function Intuition (how to choose w?)
Goal of LRM(how to choose w?)
Visualizing the Cost Function (b=0)
Visualizing the Cost Function (b=0)
Summary of LRM
Manually Selecting the values of w and b
Difficult to train for more complex problems
Efficient algorithms (Automatically finding the values of w and b)
Now in linear regression, rather than having to manually try to read a contour plot for the best value
for w and b, which isn't really a good procedure and also won't work once we get to more complex
machine learning models. What you really want is an efficient algorithm that you can write in code for
automatically finding the values of parameters w and b they give you the best fit line. That minimizes
the cost function j. There is an algorithm for doing this called gradient descent. This algorithm is one
of the most important algorithms in machine learning. Gradient descent and variations on gradient
descent are used to train, not just linear regression, but some of the biggest and most complex
models in all of AI.
Gradient Descent
Unsupervised Learning

ML Lec 1 (1).pptx

  • 1.
  • 3.
  • 4.
    Course Information Course Code:CSC354 Course Title: Machine Learning Credit Hours: 3(3,0) Lecture Hours/Week: 3 Lab Hours/Week: 0 Pre-Requisites: None Catalogue Description: This course provides the overview of machine learning along with various learning tasks. Topics include: Overview of Machine Learning; Supervised Learning; Unsupervised Learning; Reinforcement Learning; and Deep Learning.
  • 5.
  • 7.
    Machine Learning Arthur Samuel,a pioneer in the field of artificial intelligence and computer gaming, coined the term “Machine Learning”. He defined machine learning as – a “Field of study that gives computers the capability to learn without being explicitly programmed”.
  • 8.
  • 9.
    Artificial Intelligence The ability ofa digital computer or computer-controlled robot to perform tasks commonly associated with intelligent beings. AI is also defined as, • An Intelligent Entity Created By humans • Capable of Performing Tasks intelligently without being explicitly instructed. • Capable of thinking and acting rationally and humanely.
  • 10.
    Artificial Intelligence “An abilityof a computer or machine to work the same as the human brain is called Artificial Intelligence.” AI means to copy the human brain in such a way that it performs exactly how a human brain would in any particular situation by thinking and functioning just like a human. AI is still under growth but has achieved a lot by so far, and the best example to take into the account would be the Sophia an advancement of AI, Siri, etc. It does not need to be preprogrammed, and rather it uses algorithms which works for its intelligence. It incorporates Reinforcement learning, deep learning neural networks.
  • 11.
  • 12.
    Deep Learning “Deep learningis a subset of machine learning used to decode complicated issues by learning from its own methods of computation.” Deep learning is a machine learning technique that teaches computers to do what comes naturally to humans: learn by example. Deep learning is a key technology behind driverless cars, enabling them to recognize a stop sign, or to distinguish a pedestrian from a lamppost
  • 13.
  • 14.
    AI/ML/DL Machine Learning (ML)is commonly used along with AI but it is a subset of AI. ML refers to an AI system that can self-learn based on the algorithm. Systems that get smarter and smarter over time without human intervention is ML. Deep Learning (DL) is a machine learning (ML) applied to large data sets
  • 15.
    Machine Learning Arthur Samuel,a pioneer in the field of artificial intelligence and computer gaming, coined the term “Machine Learning”. He defined machine learning as – a “Field of study that gives computers the capability to learn without being explicitly programmed”.
  • 16.
  • 18.
  • 20.
  • 21.
    Supervised Learning The modelor algorithm is presented with example inputs and their desired outputs and then finding patterns and connections between the input and the output. The goal is to learn a general rule that maps inputs to outputs. The training process continues until the model achieves the desired level of accuracy on the training data. • Image Classification • Market Prediction/Regression • Spam Filtering • Speech Recognition
  • 24.
    Supervised Machine Learning Supposewe have a dataset of different types of shapes which includes square, rectangle, triangle, and Hexagon. Now the first step is that we need to train the model for each shape. •If the given shape has four sides, and all the sides are equal, then it will be labelled as a Square. •If the given shape has three sides, then it will be labelled as a triangle. •If the given shape has six equal sides then it will be labelled as hexagon. Now, after training, we test our model using the test set, and the task of the model is to identify the shape. The machine is already trained on all types of shapes, and when it finds a new shape, it classifies the shape on the bases of a number of sides, and predicts the output.
  • 25.
    Steps involved inSupervised Learning •First Determine the type of training dataset •Collect/Gather the labelled training data. •Split the training dataset into training dataset, test dataset, and validation dataset. •Determine the input features of the training dataset, which should have enough knowledge so that the model can accurately predict the output. •Determine the suitable algorithm for the model, such as support vector machine, decision tree, etc. •Execute the algorithm on the training dataset. Sometimes we need validation sets as the control parameters, which are the subset of training datasets. •Evaluate the accuracy of the model by providing the test set. If the model predicts the correct output, which means our model is accurate.
  • 26.
    Types of supervisedML Algorithms: Classification tries to find the decision boundary, which divides the dataset into different classes. Regression algorithms solve regression problems such as house price predictions and weather predictions
  • 27.
    Regression Regression algorithms areused if there is a relationship between the input variable and the output variable. It is used for the prediction of continuous variables, such as Weather forecasting, Market Trends, etc. Linear Regression Regression Trees Non-Linear Regression Bayesian Linear Regression Polynomial Regression
  • 28.
    Classification Classification algorithms areused when the output variable is categorical, which means there are two classes such as Yes-No, Male-Female, True-false, etc. Inputs are divided into two or more classes, and the learner must produce a model that assigns unseen inputs to one or more (multi-label classification) of these classes and predicting whether or not something belongs to a particular class. This is typically tackled in a supervised way. Classification models can be categorized in two groups: Binary classification and Multiclass Classification. Spam filtering is an example of binary classification, where the inputs are email (or other) messages and the classes are “spam” and “not spam”. • Random Forest • Decision Trees • Logistic Regression • Support vector Machines (SVM)
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 36.
    Cost Function Used toestimate how badly models are performing. Put simply, a cost function is a measure of how wrong the model is in terms of its ability to estimate the relationship between X and y. This is typically expressed as a difference or distance between the predicted value and the actual value.
  • 37.
    Equation of aStraight Line The equation of a straight line is y=mx+b y = m x + b, m is the gradient or slope and b is the height at which the line crosses the y -axis, also known as the y - intercept.
  • 38.
    Equation of aStraight Line
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
    Cost Function Intuition(how to choose w?)
  • 47.
    Goal of LRM(howto choose w?)
  • 48.
    Visualizing the CostFunction (b=0)
  • 49.
    Visualizing the CostFunction (b=0)
  • 50.
    Summary of LRM ManuallySelecting the values of w and b Difficult to train for more complex problems Efficient algorithms (Automatically finding the values of w and b) Now in linear regression, rather than having to manually try to read a contour plot for the best value for w and b, which isn't really a good procedure and also won't work once we get to more complex machine learning models. What you really want is an efficient algorithm that you can write in code for automatically finding the values of parameters w and b they give you the best fit line. That minimizes the cost function j. There is an algorithm for doing this called gradient descent. This algorithm is one of the most important algorithms in machine learning. Gradient descent and variations on gradient descent are used to train, not just linear regression, but some of the biggest and most complex models in all of AI.
  • 51.
  • 52.