Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Learning Objectives

On completing the module, participants will be able to:

• Describe and differentiate machine learning paradigms

• Identify possible applications of Natural Language Processing in the Kenyan local context

• Explain how robotics and computer vision can be used in different application contexts

Page 1
Module Outline
Four core topics will be covered in the module:

Machine Learning,
Deep Learning &
Natural Language
Reinforcement Computer Vision Robotics
Processing
Learning
Module Session

Machine Learning,
Deep Learning &
Natural Language
Reinforcement Computer Vision Robotics
Processing
Learning
Learning Objectives for Session
• Describe and differentiate machine learning paradigms

• Identify possible applications of the different machine learning paradigms

• Appreciate the need for quality data for building machine learning models

Page 4
Machine Learning, Deep Learning & Reinforcement
Learning
• Course Outline
• Machine Learning overview
• Supervised
• Unsupervised
• Reinforcement
• Deep learning
• Data for Machine Learning
• Quiz

Page 5
Titel of the presentation
Machine Learning
1. In basic terms, ML is the process of training a
piece of software, called a model, to make
useful predictions using a data set.
2. This predictive model can then serve up
predictions about previously unseen data.
We use these predictions to take action in a
product; for example, the system predicts
that a user will like a certain video, so the
system recommends that video to the user.
3. Often, people talk about ML as having three
broadly speaking paradigms, supervised and
unsupervised learning, Reinforcement.
References:
Image source: https://www.potentiaco.com/what-is-machine-learning-definition-types-applications-and-examples/
https://online.atingi.org/course/view.php?id=1107

Titel of the presentation Page 6


1. Supervised learning

Supervised learning is a type of ML where the model is provided with labeled training data.
Supervised learning can be separated into two types of problems —classification and regression:
• Classification uses an algorithm to accurately assign test data into specific categories. It recognizes specific entities within the
dataset and attempts to draw some conclusions on how those entities should be labeled or defined.
• Regression is used to understand the relationship between dependent and independent variables. It is commonly used to make
projections, such as for sales revenue for a given business.

But what does that mean?

References:
https://online.atingi.org/course/view.php?id=1107
https://www.ibm.com/topics/supervised-learning

Titel of the presentation Page 7


1. Supervised learning: Classification

For example, suppose you are an amateur botanist


determined to differentiate between two species of the
Lilliputian plant genus (a completely made-up plant). The two
species look pretty similar. Fortunately, a botanist has put
together a data set of Lilliputian plants she found in the wild
along with their species name.
Here's a snippet of that data set:

References:
https://online.atingi.org/course/view.php?id=1107

Titel of the presentation Page 8


Supervised learning: Classification

Leaf width and leaf length are the features (which is why the
graph is next slide labels both of these dimensions as X), while
the species is the label.
A real life botanical data set would probably contain far more
features (including descriptions of flowers, blooming times,
arrangement of leaves) but still have only one label.
Features are measurements or descriptions; the label is
essentially the "answer." For example, the goal of the data set is
to help other botanists answer the question, "Which species is
this plant?“ Therefore this dataset “labelled” because the
answer is already given.
This data set consists of only four examples. A real life data set
would likely contain vastly more examples.

References:
https://online.atingi.org/course/view.php?id=1107

Titel of the presentation Page 9


Supervised learning: Classification
Suppose we graph the leaf width and leaf length and then
color-code the species as shown in Figure a.
In supervised machine learning, you feed the features and
their corresponding labels into an algorithm in a process Figure a:
called training.

During training, the algorithm gradually determines the


relationship between features and their corresponding
labels. This relationship is called the model.

Often times in machine learning, the model is very


Figure b:
complex. However, suppose that this model can be
represented as a line that separates big-leaf from small-leaf,
Figure b.

References:
https://online.atingi.org/course/view.php?id=1107

Titel of the presentation Page 10


Supervised learning: Classification
Now that a model exists, you can use that model to classify
new plants that you find in the jungle. In the figure, the
triangles above the pattern predicted to be big-leaf variety
while those below the pattern are predicted to be small-
leaf variety
To tie it all together, classification, the model finds patterns
between data and labels that can be expressed
mathematically as functions.
Given an input feature, you are telling the system what the
expected output label is, thus you are supervising the
training.
The ML system will learn patterns on this labeled data.
In the future, the ML system will use these patterns to
make predictions on data that it did not see during training.

References:
https://online.atingi.org/course/view.php?id=1107
Image source: https://medium.com/@metehankozan/supervised-and-unsupervised-learning-an-intuitive-approach-cd8f8f64b644

Titel of the presentation Page 11


Supervised learning: Regression
You want to examine the relationship
between the age and price for used cars
sold in the last year by a car dealership
company.
Here is the table of the data:
Now, we see that we have a negative
relationship between the car price (Y)
and car age(X) – as car age increases,
price decreases.
You want to train a regression model
that will predict for you the car price
based on car age.
References:
https://www.intellspot.com/linear-regression-examples/

Titel of the presentation Page 12


Supervised learning: Regression
Let’s use the data from the table and
create our plot.
During training, the model tries to
find the line that best fits the data.
These are linear regression lines.
Once the best line is found, the
model can be used predict the
expected car price based on age of
car at any time, even for years we
did not have data.
References:
Image source: ://www.intellspot.com/linear-regression-examples/

Titel of the presentation Page 13


Supervised learning
Use cases:
Some applications of supervised learning include credit card fraud detection where the historical transaction data of a customer is
analyzed, sentiment (positive/negative) analysis of a given text document e.g. review, Crop type classification, crop disease
classification, house price prediction etc.

References:
https://online.atingi.org/course/view.php?id=1107
Image source: https://ivypanda.com/essays/business-statistics/
Image source: https://www.expressanalytics.com/blog/social-media-sentiment-analysis/

Titel of the presentation Page 14


Watch YouTube video on Supervised Learning
• YouTube video on Supervised learning:
https://www.youtube.com/watch?v=Mu3POlNoLdc

22 Jan. 2019 Titel of the presentation Page 15


2. Unsupervised learning

In unsupervised learning, the goal is to identify meaningful


patterns in the data.
To accomplish this, the machine must learn from an
unlabeled data set. In other words, the model has no hints
how to categorize each piece of data and must infer its own
rules for doing so.
In the following graph, all the examples are the same shape
because we don't have labels to differentiate between
examples of one type or another here:

References:
https://online.atingi.org/course/view.php?id=1107

Titel of the presentation Page 16


Unsupervised learning

Fitting a line to unlabeled points isn't helpful. We still end


up with examples of the same shape on both sides of the
line. Clearly we will have to try a different approach.
What is we try to find groups/clusters of points that are
closest to each other?

References:
https://online.atingi.org/course/view.php?id=1107

Titel of the presentation Page 17


Unsupervised learning

Here, we have two clusters/groups. (Note that the number


of clusters is arbitrary).
What do these clusters represent? It can be difficult to say.
Sometimes the model finds patterns in the data that you
don't want it to learn, such as stereotypes or bias.
However, when new data arrives, we can categorize it
pretty easily, assuming it fits into a known cluster.
But what if your clustering model has never seen an
example before? Will the system cluster the new example
as A or maybe B. These are some of the difficulties of
working with unlabeled data,

References:
https://online.atingi.org/course/view.php?id=1107 While clustering is very common, it is NOT the only type of unsupervised learning

Titel of the presentation Page 18


Unsupervised learning
To tie all together, in unsupervised learning,
we have the input data but the output labels
and mapping function are both unknown.

The machine learning algorithms map the


function that finds similarity among
different input data instances and group
them based on the similarity index, which is Blocks are arranged based on
shapes

the output for unsupervised learning.

In such learning, there is no supervision as


there is not existence of output labels
References:
https://online.atingi.org/course/view.php?id=1107
Image source: https://www.enjoyalgorithms.com/blogs/supervised-unsupervised-and-semisupervised-learning

Titel of the presentation Page 19


Unsupervised learning
Use cases: Some applications of unsupervised
learning include:
potential outlier

Anomaly detection: detect any sort of


outliers in data. Financial organizations may
utilize the technique to spot fraudulent
transactions and react promptly, which
ultimately can save lots of money.

Customer and market segmentation: group


people that have similar traits and create
customer personas for more efficient
marketing and targeting campaigns.
References:
https://online.atingi.org/course/view.php?id=1107
Image source: https://documentation.mindsphere.io/MindSphere/apis/analytics-anomalydetection/api-anomalydetection-overview.html
Image source: https://www.businessstudynotes.com/marketing/principle-of-marketing/consumer-market-segmentation/

Titel of the presentation Page 20


Watch YouTube video on Unsupervised learning
1.YouTube video on Unsupervised learning:
https://www.youtube.com/watch?v=yteYU_QpUxs

Titel of the presentation Page 21


3. Reinforcement learning
Reinforcement learning (RL) differs from other types of
machine learning.
In RL you don't collect examples with labels.
Imagine you want to teach a machine to play a very basic
video game and never lose. You set up the model (often
called an agent in RL) with the game, and you tell the
model not to get a "game over" screen.
During training, the agent receives a reward when it
performs this task, which is called a reward function.

Check here to view a blog post by Aneek Das on The very basics of Reinforcement Learning
References:
https://online.atingi.org/course/view.php?id=1107
https://becominghuman.ai/the-very-basics-of-reinforcement-learning-154f28a79071

Titel of the presentation Page 22


Reinforcement learning
In order to produce intelligent programs (also called agents),
reinforcement learning goes through the following steps:
1. Input/internal state is observed by the agent.
2. Decision making function is used to make the agent
perform an action.
3. After the action is performed, the agent receives reward or
reinforcement from the environment.
4. The state-action pair information about the reward is
stored.

References:
https://online.atingi.org/course/view.php?id=1107
https://towardsdatascience.com/types-of-machine-learning-algorithms-you-should-know-953a08248861
Image source: https://becominghuman.ai/the-very-basics-of-reinforcement-learning-154f28a79071

Titel of the presentation Page 23


Reinforcement learning
Use cases:
Some applications of the reinforcement learning algorithms are
computer played board games (Chess, Go), robotic hands, and
self-driving cars.

References:
https://towardsdatascience.com/types-of-machine-learning-algorithms-you-should-know-953a08248861
Image source: https://www.deepmind.com/research/highlighted-research/alphago
Image source: https://www.therobotreport.com/reinforcement-learning-industrial-robotics/
Image source: https://www.researchgate.net/figure/Deep-reinforcement-learning-DRL-for-self-driving-cars_fig1_346369704

Titel of the presentation Page 24


Watch YouTube video on Reinforcement Learning
1.YouTube video on Reinforcement Learning:
https://www.youtube.com/watch?v=kEGAMppyWkQ
2.YouTube video on training robotic arms:
https://www.youtube.com/watch?v=ZhsEKTo7V04

Titel of the presentation Page 25


4. Deep learning algorithms
There are several kinds of machine learning algorithms. One such powerful
kind is Artificial Neural Networks (ANN).
ANN methods allow computers to learn by example in a similar way to the
human brain. Neural Networks are layers of nodes, much like the human
brain is made up of neurons. Nodes within individual layers are connected
to adjacent layers.
Deep learning is a subfield of machine learning, and neural networks make
up the backbone of deep learning algorithms.
Deep Learning is a computer software that mimics the network of neurons
in a brain.
It is called deep learning because it makes use of deep neural networks.
This learning can be supervised, semi-supervised or unsupervised.
References:
https://www.guru99.com/deep-learning-tutorial.html
https://www.educative.io/blog/deep-learning-beginner-tutorial
https://www.ibm.com/cloud/blog/ai-vs-machine-learning-vs-deep-learning-vs-neural-networks
Image source: https://developer.ibm.com/articles/an-introduction-to-deep-learning/

Titel of the presentation Page 26


How Does Deep Learning Work?

The term ‘deep learning’ is coined because the neural networks have various layers that
enable
learning, unlearning, and relearning. The network is said to be deeper based on the
number of layers it has.

1. ANN comprising many layers, drive deep learning. Deep Neural Networks (DNNs) are
such types of networks where each layer can perform complex operations such as
representation and abstraction that make sense of images, sound, and text.

2. A single neuron in the human brain receives thousands of signals from other neurons.
In an artificial neural network, signals travel between nodes and assign corresponding
weights. A heavier weighted node will exert more effect on the next layer of nodes.

3. The final layer compiles the weighted inputs to produce an output.

4. Deep learning systems require powerful hardware because they have a large amount of
data being processed and involves several complex mathematical calculations. Even
with such advanced hardware, however, training a neural network can take weeks.
References:
https://www.simplilearn.com/tutorials/deep-learning-tutorial/what-is-deep-learning

Titel of the presentation Page 27


Deep Learning Use cases
Deep learning algorithms can learn from unstructured and unlabeled data, such as images, sound, and text, thus achieving
impressive results in various tasks.

1. Image Recognition: Deep learning is beneficial for computer vision applications, as discussed previously. Google,
Facebook, IBM, and others have successfully used deep learning to train computers to recognize human faces and
identify the contents of images.

2. Speech Processing: Deep learning recognizes human speech, converts text into addresses, and processes natural
language. As a result, chatbots and voice assistants such as Siri and Cortana can carry on conversations with users based
on their context.

3. Translation: After a deep learning system has been trained to understand one language, the next logical step is to teach
it to understand multiple languages and translate between them. Several vendors offer APIs with deep learning-based
translation capabilities.

4. Recommendation Engines: Users have grown accustomed to websites like Amazon and services like Netflix offering
recommendations based on their past usage. A lot of these recommendation engines are powered by deep learning.
This allows them to improve over time and find hidden correlations in preferences that humans might miss.

5. Medicine: Deep learning also has many potential uses in the medical field. It could, for instance, perform better than
human radiologists at reading scans and power diagnostic engines that could augment human physicians.

References:
https://h2o.ai/wiki/deep-learning-use-cases/
https://www.knowledgehut.com/blog/data-science/deep-learning-applications

Titel of the presentation Page 28


5. Data for machine (deep) learning
Quality data is at the heart of the success of enterprise AI. And accordingly, it remains the
main source of challenges for companies that want to apply ML in their applications and
operations.

As machine learning models grow in number and size, they will require more training data.

Unfortunately, obtaining training data and labeling still requires considerable manual
effort and is largely application specific.

ML teams can start with prelabeled datasets, but they will eventually need to collect and
label their own custom data to scale their efforts. Depending on the application, labeling
can become extremely expensive and labor-intensive.

In many cases, companies have enough data, but they can’t deal with quality issues.
Biased, mislabeled, inconsistent or incomplete data reduces the quality of ML models,
which in turn harms the ROI of AI initiatives.

If you train ML models with bad data, model predictions will be inaccurate.
References:
https://venturebeat.com/ai/why-data-remains-the-greatest-challenge-for-machine-learning-projects/

Titel of the presentation Page 29


Summary of Key Points

• ML is the process of training a piece of software, called a model, to make useful predictions
using a data set.
• There are three basic types of machine learning algorithms including supervised, unsupervised
and reinforcement learning algorithms.
• Supervised learning is a type of ML where the model is provided with labeled training data.
Supervised learning can be separated into two types of problems: classification and regression
• In unsupervised learning, the goal is to identify meaningful patterns in the data and the
machine learns from unlabeled data set.
• Reinforcement learning (RL) differs from other types of machine learning. During training, the
agent receives a reward when it performs this task, which is called a reward function.
• Deep Learning is a computer software that mimics the network of neurons in a brain. It is a
subset of machine learning.
• Quality data is at the heart of the success of enterprise AI. If you train ML models with bad data,
model predictions will be inaccurate

Titel of the presentation Page 30


Quiz
• Differentiate the three basic types of machine learning. Choose the correct answer.
• Supervised, Unsupervised, Reinforcement Learning
• Supervised, Unsupervised, Deep learning
• Classification, Unsupervised, Reinforcement learning
• What is the difference between supervised and unsupervised machine learning? Choose the correct answer.
• Supervised learning learns from the unlabeled data and makes a future prediction as output while Unsupervised
learning uses labeled input data to learn patterns.
• Supervised learning learns from the labeled data and makes a future prediction as output while Unsupervised
learning uses unlabeled input data to learn patterns.
• Supervised learning learns from the labeled data and learns patterns in data Unsupervised learning uses unlabeled
input data to make future predictions.
• What is the difference between machine learning and deep learning. Which of the below statements is not correct
• Machine learning trains machines to take decisions on their own, based on past data while deep learning learns the
features from the data it is provided
• Deep learning Works well on the low-end system, so you don't need large machines
• Deep enables machines to take decisions with the help of artificial neural networks
• Deep learning is a subset of machine learning

9/25/2023 31
Additional Reading

• Basic of Machine Learning -


https://online.atingi.org/course/view.php?id=2575&section=1
• Introduction, Getting started with ML, Framing a problem -
https://online.atingi.org/course/view.php?id=1107
• Machine Learning – Tutorial Points -
https://www.tutorialspoint.com/machine_learning/machine_learning_tutorial.p
df
• Types of machine learning algorithms: https://towardsdatascience.com/types-of-
machine-learning-algorithms-you-should-know-953a08248861
• Deep learning use cases - https://h2o.ai/wiki/deep-learning-use-cases/
• ML Glossary - https://developers.google.com/machine-learning/glossary

You might also like