0% found this document useful (0 votes)
20 views70 pages

Basics of ML

Uploaded by

Prabhavathy M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views70 pages

Basics of ML

Uploaded by

Prabhavathy M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 70

Machine Learning

& A.I. LETS TEACH MACHINE HOW TO LEARN FROM DATA


A Foody
LOGIC

INPUT OUTPUT

A TRAINED BRAIN
A Naive Machine
To minimize the
difference between
predicted output &
actual output

f(x)
INPUTS Learns the
parameter
s of the
function –
OLD OUTPUT An
Algorithm

A Chosen Statistical Function


To minimize the
difference between
predicted output &
actual output

INPUT

f(x) What is f(x) –


OUTPUT

A Trained Statistical Function


MACHIN
E LETS TEACH MACHINE HOW TO LEARN FROM DATA

LEARNIN
Machine Learning
“Machine Learning (ML) at its most basic is the practice of using algorithms to
parse data, learn from it, and then make a determination or prediction about
something in the world.” – Nvidia

“A computer program is said to learn from experience E with respect to some


class of tasks T and performance measure P if its performance at tasks in T, as
measured by P, improves with experience E.” -Tom M. Mitchell

8
What is Machine Learning?
• In basic terms, ML is the process of training a piece of software, called a model,
to make useful predictions using a data set.
• 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.

Machine Learning
Historical data algorithm

training

input prediction Future


New data Learned model attributes

9
ARTIFICIAL
INTELLIGENCE
LETS MACHINE SOLVE A PROBLEM FROM DATA
Artificial Intelligence is a branch of computer
science dedicated to creating intelligent
machines that work and react like a human
brain.
The development of AI

Source: https://blogs.nvidia.com/blog/2016/07/29/whats-difference-artificial-intelligence-machine-learning-deep-learning-ai/
Relationship of AI, ML and DL
Artificial Intelligence
A technique which enables machines to
mimic human behaviour

Machine learning
Subset of AI technique which use
statistical methods to enables
machines to improve with
experience

Deep Learning
Subset of ML which make the
computation of multi-layer
neural network feasible
ARTIFICIAL INTELLIGENCE MACHINE LEARNING
AI stands for Artificial intelligence, where ML stands for Machine Learning which is defined
intelligence is defined acquisition of as the acquisition of knowledge or skill
knowledge intelligence is defined as a ability
to acquire and apply knowledge.
The aim is to increase chance of success and The aim is to increase accuracy, but it does not
not accuracy. care about success
It work as a computer program that does It is a simple concept machine takes data
smart work and learn from data.
The goal is to simulate natural intelligence to The goal is to learn from data on certain task
solve complex problem to maximize the performance of machine on
this task.
AI is decision making. ML allows system to learn new things from
data.
It leads to develop a system to mimic It involves in creating self learning
human to respond behave in a algorithms.
circumstances.
AI will go for finding the optimal solution. ML will go for only solution for that whether it is
optimal or not.
AI leads to intelligence or wisdom. ML leads to knowledge.
DEEP
LEARNING
LETS MACHINE SOLVE A PROBLEM FROM DATA

Deep Learning (DL) is a particular kind of Machine Learning (ML) algorithm that
is inspired by the functionality of our brain cells called neurons which led to
the concept of Artificial Neural Network (ANN).
Traditional ML vs. Deep
Learning
Traditional Machine Learning Deep Learning
Low hardware requirements: Given the High hardware requirements: To execute
limited computing amount, the computer matrix operation on massive data, the
does not need a GPU for parallel computing computer needs GPU to perform parallel
generally computing

Applicable to training under a small data The performance can be high when high
amount and whose performance cannot be dimensional weight parameters and massive
improved continuously as the data amount training data are provided
increases
Level-by-level problem breakdown End-to-End learning

Manual feature selection Algorithm-based automatic feature selection

Easy-to-explain features Hard-to-explain features


18
USE CASES
AI AND MACHINE LEARNING USE CASES
Artificial Intelligence (AI) can be used to create a fully
autonomous
car’s to travel between destinations without a human operator.

SELF DRIVING CAR


Sophia — The Humanoid Robot: Sophia is a social humanoid robot
developed by Hong Kong-based company Hanson Robotics.
Sophia is the first humanoid robot which is being granted a ‘robot
citizenship’ by Saudi Arabia.

HUMANOID
Snapchats filters use augmented reality and machine learning for your
flower crowns selfies.

SNAPCHAT
Netflix — The Application that knows what you want: The Netflix
recommendation system is powered by Machine Learning (ML)
algorithms and that is what makes their system so good in
predicting the movies that you are most likely to watch and
hence show them as suggestions to you.

NETFLIX
Sentiment analysis is a real-time machine learning application that
determines the emotion or opinion of the speaker or the writer. For
instance, if someone has written a review or email (or any form of a
document), a sentiment analyser will instantly find out the actual
thought and tone of the text. This sentiment analysis application
can are used to analyse a review based website, decision-making
applications, etc.

SENTIMENT
ANALYSI
Image Recognition is one of the most significant and notable
Machine Learning and AI techniques: an approach for cataloguing
and detecting a feature or an object in the digital image. This
technique is being adopted for further analysis, such as pattern
recognition, face detection, or face recognition.

IMAGE
RECOGNITION
Fact Checks! Spotting Fake News, Reporting Articles

JOURNALISM
You Healthy! Patient diagnoses and treatment

HEALTHCAR
E
Hospitality, Hotel Selection, Customer Behavior,
Recommendations,
All five stars!! …

TOURIS
M
You’re Hired! Skills based job search and resume shortlisting and
interview selection, Attrition Rate …

JOB
HIRING(HR)
Happy Clients! Service improvising by speech analytics, sentiment
analysis, text analytics, NLP …

CUSTOMER
SERVICE
Banks are now using the latest advanced technology machine learning
has to offer to help prevent fraud & protect accounts from hackers. The
algorithms determine what factors to consider to create a filter to keep
harm at bay. Various sites that are unauthentic will be automatically
filtered out and restricted from initiating transactions.

BANKING
Computer Vision major areas

http://ivg.au.tsinghua.edu.cn/DRLCV/CVPR19_tutorial.pdf
32
Computer Vision
• Challenges

Scale

View points Illumination Occlusion


33
Computer Vision application
Electronics attendance Traffic analysis

34
Computer Vision application
Detecting defects in Fruits Authentication

35
Natural Language Processing
• How to program computers to process and analyze large amounts of
natural language data?

https://algorithmxlab.com/blog/natural-language-processing/ 36
NLP + Computer Vision
application
• Clinical decision support
• Automated systems could
help clinicians cope with
large amounts of images by
answering questions about
the image contents.

Lau, J.J., Gayen, S., Abacha, A.B. and Demner-Fushman, D., 2018. A dataset of clinically generated visual questions and answers about radiology images. Scientific data, 5(1), pp.1-10.
37
NLP + Computer Vision
application

• Fashion advice
• Individuals with and
without vision
impairments get fashion
advice

38
Basic Concepts
of ML Learning Process
ML & Rule-based system
differences
Rule-based system Output
• A rule-based system produces pre-defined outcomes that are
based on a set of certain rules coded by humans.
• For example, in a rules-based algorithm or platform, a bank
Mapping
customer's personal and financial information can be Output from
measured against a programmed set of levels, and if the features
numbers were to match, then a home loan would be granted.
Hand- Hand-
Machine learning designed designed
• The machine learning algorithm analyzes the dataset and features features
determines relationships within that data.
• Logic is embedded in the algorithm and was not coded by a
human. Input Input
• The model trains itself and learns from the data, creating a
cohesive relationship between data inferences and future data Rule-based Classic
outputs. systems machine
learning
ML versus Rule-based
algorithms
Rule-based Machine learning
Human involved in all No human
aspects involved

Deterministic System Probabilistic


characteristics

Statistical rules are


None Learning algorithm
automatically learned
by machines

Not scalable Project scale Can be easily scaled


Large and good
Small and
Dataset quality data for
simple data
accurate prediction
When to use ML and Rule-based
algorithms
When to use rule-based system?
• The situations in which there are lower volumes of data
• The rules are relatively simple
• Require speedy output
• When there is a clear and constant data distribution

When to use Machine learning?


• When simple rules/guidelines don’t apply
• To handle complex rules and intensive issues with a relatively variable
environment
• For long terms as it is more manageable to constant improvement and
enhancement through algorithm and data preparation.
• Data distinction changes over time, requiring constant adaptation of programs.
Rational Understanding of ML
algorithms
Target equation

Ideal

Machine Learning Actual Hypothesis function


Training data
D: {, … … ,} algorithm

• Target function is unknown. Learning algorithms cannot obtain a perfect function


.
• Hypotheses function approximates function , but maybe different from function .
TYPES OF
DATA LETS CLASSIFY DATASETS

© Amit
TYPES OF
MACHINE
LETS CLASSIFY DIFFERENT TYPE OF MACHINE LEARNING

LEARNING
Machine Learning algorithms
Supervised Learning Classification
Develop predictive
model based on both
input and output data
Regression

Machine
Learning Unsupervised Learning

Group and interpret


date based only on input Clustering
data
SUPERVISED
AI AND MACHINE LEARNING USE CASES

LEARNING
Supervised learning is when input variables (X) called
Featuresvariable
output and (Y) called label or a class use an algorithm to learn the
mapping function from the input to output.

Y = f(X)
The goal is to approximate the mapping function so well that when you
have new input data (X) that you can predict the output variables (Y) for
that data.
Example
Input data: training data Model Prediction

apple

Output data: labels

apple apple apple apple

orange orange orange orange Unseen data: testing data


Supervised learning

Supervised
machine learning

Regression Classification

52
Supervised learning -
Regression
• Regression predictive modeling is the task of approximating a
mapping function from input variables to a continuous output
variable .
• A continuous output variable is a real-value, such as an integer or
floating point value. These are often quantities, such as amounts
and sizes.
• Examples of regression problems:
• What is the price of the houses?
• What is the height of the students?

53
Supervised learning -
Classification
• Classification predictive modeling is the task of approximating a
mapping function from input variables to discrete output variables
• The output variables are often called labels or categories. The
mapping function predicts the class or category for a given
observation.
• Examples of classification problems:
• Is the person boy or girl?
• Is the email spasm or not spasm?
• Is she happy or not?

54
55
UNSUPERVISED
LEARNING
AI AND MACHINE LEARNING USE CASES
• Unsupervised Learning is
when only have input
data (X) and no
corresponding output
variables.
• The goal for unsupervised
learning is to model the
underlying structure or
distribution in the data in
order to learn more about the
data.
• Algorithms are left to their
own devises to discover and
present the interesting
structure in the data.
Example

Input data: training data Prediction


Model

apple
Reinforcement learning
Reinforcement learning is quite different from the other two types of machine learning. In reinforcement learning,
there’s no training data. The algorithm works on a rewards-based system. Reinforcement learning involves an
autonomous agent that observes the environment and then selects an action that will lead to rewards. This helps the
algorithm improve in the long run on its own. The best example of the reinforcement learning approach is creating a
game.
Machine Learning process
Machine learning
algorithm

Dataset Data Collection


Modeling

Hyper-
Data preparation Validation parameter
tuning Deployment
and
Feature Feature monitoring
Data
Extraction & Scaling &
Processing
Engineering Selection
Training

Repeat till satisfactory model performance

61
62
WHY IS AI & ML
ARE
TRENDING NOW?
85% of growth from new Geo-location
types of data with Senso
Data
r
Machine generated data Machine Data
Generated
increasing 15x
Socia
l
Network
Web s
2040
Logs
Click
Digital Universe will
Streams increase by 160
Document
s 2014 Zettabytes
Email 31% of enterprises managing more than
s Unstructured 1
Data Petabyte
ERP , CRM 2012
System
Data Digital Universe = 20
Zettabytes
ML in PYTHON

1. RAW Data Collection


a. BeautifulSoup library
b. Streaming source – Kafka,
Flume

2. Data Presentation & Cleanup


a. Pandas library

3. Data Visualization
a. Matplotlib and Seaborn library

4. ML Modeling
a. Tensorflow/SkLearn library

5. Deployment & BI Reports


a. Tensorflow Serving
Stage 1. Train A Model with Examples Datasets
(Training)

Cat

Dog

OUTPUT
Car

Fruit
An Artificial Intelligence
model is a
mathematical
function
Stage 2. Predict with the Trained Model
Machine Learning Flow
Machine Learning Lifecycle

1 2 3 4 5

Define ML use cases Data Exploration Select Algorithm Data Pipeline & Build ML Model
Define Specific ML use Perform exploratory Choose the right ML feature engineering Develop the first
cases for the Project. data analysis to Algorithm for the Create the right iteration of the ML
understand the Task features from raw Model.
data data for the ML Task.

1 9 8 7 6
0
Monitor Model OOppeerraattiioonna Plan for Deployment Present Results Iterate ML Model
alliizzee MMooddeell Present Results of the Refine the ML Model
model in a way that to improve
demonstrates its value
to stakeholders.
Happy
Learning!

You might also like