SlideShare a Scribd company logo
1 of 60
Download to read offline
Online Learning
Felipe Almeida
Rio Machine Learning Meetup August / 2016
Introduction, overview and examples
Structure
● Introduction
● Use cases
● Types of Targets
● Approaches
● Current Trends / Related Areas
● Links
2
Introduction
● Online Learning is generally described as doing machine learning
in a streaming data setting, i.e. training a model in consecutive
rounds
3
Introduction
● Online Learning is generally described as doing machine learning
in a streaming data setting, i.e. training a model in consecutive
rounds
○ At the beginning of each round the algorithm is presented with
an input sample, and must perform a prediction
4
Introduction
● Online Learning is generally described as doing machine learning
in a streaming data setting, i.e. training a model in consecutive
rounds
○ At the beginning of each round the algorithm is presented with
an input sample, and must perform a prediction
○ The algorithm verifies whether its prediction was correct or
incorrect, and feeds this information back into the model, for
subsequent rounds
5
Introduction
6
Whereas in batch (or offline) learning you have
access to the whole dataset to train on
x1
x2
x3
... xd
y
x1
x2
x3
... xd
y
x1
x2
x3
... xd
y
x1
x2
x3
... xd
y
x1
x2
x3
... xd
y
D features
Nsamples
Trained model
Batch training
Introduction
7
In online learning your model evolves as you
see new data, one example at a time
x1
x2
x3
... xd
y
Timeincreases
Input data at time t Online update
model at time t
x1
x2
x3
... xd
y
Input data at time t+1 Online update
model at time t+1
x1
x2
x3
... xd
y
Input data at time t+2 Online update
model at time t+2
Introduction
● In other words, you need to answer a sequence of questions but
you only have access to answers to previous questions
8
Introduction
● In other words, you need to answer a sequence of questions but
you only have access to answers to previous questions
9
Adapted from Shalev-Shwartz 2012
Introduction
● In other words, you need to answer a sequence of questions but
you only have access to answers to previous questions
10
Each t represents a
trial
Adapted from Shalev-Shwartz 2012
Introduction
● In other words, you need to answer a sequence of questions but
you only have access to answers to previous questions
11
Each t represents a
trial
Adapted from Shalev-Shwartz 2012
xt
is the input data for
trial t
Introduction
● In other words, you need to answer a sequence of questions but
you only have access to answers to previous questions
12
Each t represents a
trial
Adapted from Shalev-Shwartz 2012
xt
is the input data for
trial t
pt
is the prediction for the
label corresponding to xt
Introduction
● In other words, you need to answer a sequence of questions but
you only have access to answers to previous questions
13
Each t represents a
trial
Adapted from Shalev-Shwartz 2012
xt
is the input data for
trial t
pt
is the prediction for the
label corresponding to xt
This is the difference
between what you
predicted and the actual
label
Introduction
● In other words, you need to answer a sequence of questions but
you only have access to answers to previous questions
14
Each t represents a
trial
xt
is the input data for
trial t
pt
is the prediction for the
label corresponding to xt
This is the difference
between what you
predicted and the actual
label
After computing the loss, the algorithm will use this information to
update the model generating the predictions for the next trials
Introduction: Main Concepts
The main objective of online learning algorithms is to minimize the
regret.
15
Introduction: Main Concepts
The main objective of online learning algorithms is to minimize the
regret.
The regret is the difference between the performance of:
● the online algorithm
● an ideal algorithm that has been able to train on the whole data
seen so far, in batch fashion
16
Introduction: Main Concepts
In other words, the main objective of an online machine learning
algorithm is to try to perform as closely to the corresponding offline
algorithm as possible.
17
Introduction: Main Concepts
In other words, the main objective of an online machine learning
algorithm is to try to perform as closely to the corresponding offline
algorithm as possible.
This is measured by the regret.
18
Use cases
● Online algorithms are useful in at least two scenarios:
19
Use cases
● Online algorithms are useful in at least two scenarios:
● When your data is too large to fit in the memory
○ So you need to train your model one example at a time
20
Use cases
● Online algorithms are useful in at least two scenarios:
● When your data is too large to fit in the memory
○ So you need to train your model one example at a time
● When new data is constantly being generated, and/or is
dependent upon time
21
Use cases
Some cases where data is constantly being generated and you need
quick predictions:
22
Use cases
Some cases where data is constantly being generated and you need
quick predictions:
● Real-time Recommendation
● Fraud Detection
● Spam detection
● Portfolio Selection
● Online ad placement
23
Types of Targets
There are two main ways to think about an online learning problem, as far as
the target functions (that we are trying to learn) are concerned:
24
Types of Targets
There are two main ways to think about an online learning problem, as far as
the target functions (that we are trying to learn) are concerned:
● Stationary Targets
○ The target function you are trying to learn does not change over time
(but may be stochastic)
25
Types of Targets
There are two main ways to think about an online learning problem, as far as
the target functions (that we are trying to learn) are concerned:
● Stationary Targets
○ The target function you are trying to learn does not change over time
(but may be stochastic)
● Dynamic Targets
○ The process that is generating input sample data is assumed to be
non-stationary (i.e. may change over time)
○ The process may even be adapting to your model (i.e. in an
adversarial manner) 26
Example I: Stationary Targets
For stationary targets, the input-generating process is a single, but
unknown, function of the attributes.
27
Example I: Stationary Targets
For stationary targets, the input-generating process is a single, but
unknown, function of the attributes.
● Ex.: Some process generates, at each time step t, inputs of the
form (x1
, x2
, x3
) where each attribute is a bit, and the label y is the
result of (x1
v (x2
^ x3
)):
28
Example I: Stationary Targets
For stationary targets, the input-generating process is a single, but
unknown, function of the attributes.
● Ex.: Some process generates, at each time step t, inputs of the
form (x1
, x2
, x3
) where each attribute is a bit, and the label y is the
result of (x1
v (x2
^ x3
)):
29
1 0 1 1
0 1 1 1
0 0 0 0
1 0 0 1
Input at time t
Input at time t+1
Input at time t+2
Input at time t+3
x1
x2
x3
y
Example I: Stationary Targets
For stationary targets, the input-generating process is a single, but
unknown, function of the attributes.
● Ex.: Some process generates, at each time step t, inputs of the
form (x1
, x2
, x3
) where each attribute is a bit, and the label y is the
result of (x1
v (x2
^ x3
)):
30
1 0 1 1
0 1 1 1
0 0 0 0
1 0 0 1
Input at time t
Input at time t+1
Input at time t+2
Input at time t+3
x1
x2
x3
y
From the point of view of the
online learning algorithm,
obviously!
Example II: Dynamic Targets
Spam filtering
The objective of a good spam filter is to accurately model the following
function:
31
Example II: Dynamic Targets
Spam filtering
The objective of a good spam filter is to accurately model the following
function:
32
x1
x2
x3
x4
... xd {0,1}
Example II: Dynamic Targets
Spam filtering
The objective of a good spam filter is to accurately model the following
function:
33
Features extracted from an e-mail
Spam or not spam?
model
x1
x2
x3
x4
... xd {0,1}
Example II: Dynamic Targets
Spam filtering
● So suppose you have learned that the presence of the word
“Dollars” implies that an e-mail is likely spam.
34
Example II: Dynamic Targets
Spam filtering
● So suppose you have learned that the presence of the word
“Dollars” implies that an e-mail is likely spam.
● Spammers have noticed that their scammy e-mails are falling prey
to spam filters so they change tactics:
35
Example II: Dynamic Targets
Spam filtering
● So suppose you have learned that the presence of the word
“Dollars” implies that an e-mail is likely spam.
● Spammers have noticed that their scammy e-mails are falling prey
to spam filters so they change tactics:
○ So instead of using the word “Dollars” they start using the
word “Euro”, which fools your filter but also accomplishes
their goal (have people read the e-mail)
36
Approaches
A couple of approaches have been proposed in the literature:
● Online Learning from Expert Advice
37
Approaches
A couple of approaches have been proposed in the literature:
● Online Learning from Expert Advice
● Online Learning from Examples
38
Approaches
A couple of approaches have been proposed in the literature:
● Online Learning from Expert Advice
● Online Learning from Examples
● General algorithms that may also be used in the online setting
39
Approaches: Expert Advice
In this approach, it is assumed that the algorithm has multiple oracles
(or experts at its disposal), which its can use to produce its output, in
each trial.
40
Approaches: Expert Advice
In this approach, it is assumed that the algorithm has multiple oracles
(or experts at its disposal), which its can use to produce its output, in
each trial.
In other words, the task of this online algorithm is simply to learn which
of the experts it should use.
41
Approaches: Expert Advice
In this approach, it is assumed that the algorithm has multiple oracles
(or experts at its disposal), which its can use to produce its output, in
each trial.
In other words, the task of this online algorithm is simply to learn which
of the experts it should use.
The simplest algorithm in this realm is the Randomized Weighted
Majority Algorithm
42
Approaches: Expert Advice
Randomized Weighted Majority Algorithm
● Every expert has a weight (starting at 1)
● For every trial:
○ Randomly select an expert (larger weight => more likely)
○ Use that expert’s output as your prediction
○ Verify the correct answer
○ For each expert:
■ If it was mistaken, decrease its weight by a constant factor
43
Approaches: Learning from Examples
Learning from examples is different from using Expert Advice inasmuch
as we don’t need to previously define prebuild experts we will derive
our predictions from.
44
Approaches: Learning from Examples
Learning from examples is different from using Expert Advice inasmuch
as we don’t need to previously define prebuild experts we will derive
our predictions from.
We need, however, to know what Concept Class we want to search
over.
45
Approaches: Learning from Examples
A Concept Class is a set of of functions (concepts) that subscribe to a
particular model.
46
Approaches: Learning from Examples
A Concept Class is a set of of functions (concepts) that subscribe to a
particular model.
Some examples of concept classes are:
● The set of all monotone disjunctions of N variables
● The set of non-monotone disjunctions of N variables
● Decision lists with N variables
● Linear threshold formulas
● DNF (disjunctive normal form) formulas
47
Approaches: Learning from Examples
The Winnow Algorithm is one example of a simple algorithm that
learns monotone disjunctions online.
48
Approaches: Learning from Examples
The Winnow Algorithm is one example of a simple algorithm that
learns monotone disjunctions online.
In other words, it learns any concept (function), provided the concept
belongs to the Concept Class of monotone disjunctions.
49
Approaches: Learning from Examples
The Winnow Algorithm is one example of a simple algorithm that
learns monotone disjunctions online.
In other words, it learns any concept (function), provided the concept
belongs to the Concept Class of monotone disjunctions.
It also uses weights, as in the previous example.
50
Approaches: Learning from Examples
Winnow algorithm
● Initialize all weights (w1
, w2
,... wn
) to 1
● Given a new example:
○ Predict 1 if wT
x > n
○ Predict 0 otherwise
● Check the true answer
● For each input attribute:
○ If algorithm predicted 1 but true answer was 0, double the value of
every weight corresponding to an attribute = 1
○ If algorithm predicted 0 but true answer was 1, halve the value of
each weight corresponding to an attribute = 0 51
Approaches: Learning from Examples
Winnow algorithm
● Initialize all weights (w1
, w2
,... wn
) to 1
● Given a new example:
○ Predict 1 if wT
x > n
○ Predict 0 otherwise
● Check the true answer
● For each input attribute:
○ If algorithm predicted 1 but true answer was 0, double the value of
every weight corresponding to an attribute = 1
○ If algorithm predicted 0 but true answer was 1, halve the value of
each weight corresponding to an attribute = 0 52
We aimed too low,
let’s try to make our
guess higher
Approaches: Learning from Examples
Winnow algorithm
● Initialize all weights (w1
, w2
,... wn
) to 1
● Given a new example:
○ Predict 1 if wT
x > n
○ Predict 0 otherwise
● Check the true answer
● For each input attribute:
○ If algorithm predicted 1 but true answer was 0, double the value of
every weight corresponding to an attribute = 1
○ If algorithm predicted 0 but true answer was 1, halve the value of
each weight corresponding to an attribute = 0 53
We aimed too high,
let’s try to make our
guess lower
Approaches: Other Approaches
More general algorithms can also be used in an online setting, such as:
54
Approaches: Other Approaches
More general algorithms can also be used in an online setting, such as:
● Stochastic Gradient Descent
55
Approaches: Other Approaches
More general algorithms can also be used in an online setting, such as:
● Stochastic Gradient Descent
● Perceptron Learning Algorithm
56
Current Trends / Related Areas
Adversarial Machine Learning
● Refers to scenarios where your input-generating process is an
adaptive adversary
● Applications in:
○ Information Security
○ Games
57
Current Trends / Related Areas
One-shot Learning
● Refers to scenarios where your must perform predictions after
seeing just a few, or even a single input sample
● Applications in:
○ Computer Vision
58
Links
● http://ttic.uchicago.edu/~shai/papers/ShalevThesis07.pdf
● Blum 1998 Survey Paper
● UofW CSE599S Online Learning
● Machine Learning From Streaming data
● Twitter Fighting Spam with BotMaker
● CS229 - Online Learning Lecture
● Building a real time Recommendation Engine with Data Science
● Online Optimization for Large Scale Machine Learning by prof A.
Banerjee
● Learning, Regret, Minimization and Equilibria
59
Links
● https://github.com/JohnLangford/vowpal_wabbit
● Shai Shalev-Shwartz 2011 Survey Paper
● Hoi et al 2014 - LIBOL
● MIT 6.883 Online Methods in Machine Learning
60

More Related Content

What's hot

Bias and variance trade off
Bias and variance trade offBias and variance trade off
Bias and variance trade offVARUN KUMAR
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine LearningKnoldus Inc.
 
Unsupervised learning
Unsupervised learningUnsupervised learning
Unsupervised learningamalalhait
 
Multi armed bandit
Multi armed banditMulti armed bandit
Multi armed banditJie-Han Chen
 
Machine Learning With Logistic Regression
Machine Learning  With Logistic RegressionMachine Learning  With Logistic Regression
Machine Learning With Logistic RegressionKnoldus Inc.
 
Feature selection
Feature selectionFeature selection
Feature selectiondkpawar
 
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Simplilearn
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural NetworkAtul Krishna
 
Deep Reinforcement Learning and Its Applications
Deep Reinforcement Learning and Its ApplicationsDeep Reinforcement Learning and Its Applications
Deep Reinforcement Learning and Its ApplicationsBill Liu
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural networkGauravPandey319
 
Applications in Machine Learning
Applications in Machine LearningApplications in Machine Learning
Applications in Machine LearningJoel Graff
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent methodSanghyuk Chun
 
Machine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksMachine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksFrancesco Collova'
 
Machine Learning Landscape
Machine Learning LandscapeMachine Learning Landscape
Machine Learning LandscapeEng Teong Cheah
 
Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkKnoldus Inc.
 
Supervised Unsupervised and Reinforcement Learning
Supervised Unsupervised and Reinforcement Learning Supervised Unsupervised and Reinforcement Learning
Supervised Unsupervised and Reinforcement Learning Aakash Chotrani
 
Linear regression
Linear regressionLinear regression
Linear regressionMartinHogg9
 

What's hot (20)

Bias and variance trade off
Bias and variance trade offBias and variance trade off
Bias and variance trade off
 
Machine Learning
Machine Learning Machine Learning
Machine Learning
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
 
Unsupervised learning
Unsupervised learningUnsupervised learning
Unsupervised learning
 
Multi armed bandit
Multi armed banditMulti armed bandit
Multi armed bandit
 
Machine Learning With Logistic Regression
Machine Learning  With Logistic RegressionMachine Learning  With Logistic Regression
Machine Learning With Logistic Regression
 
Feature selection
Feature selectionFeature selection
Feature selection
 
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
 
Deep Reinforcement Learning and Its Applications
Deep Reinforcement Learning and Its ApplicationsDeep Reinforcement Learning and Its Applications
Deep Reinforcement Learning and Its Applications
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Applications in Machine Learning
Applications in Machine LearningApplications in Machine Learning
Applications in Machine Learning
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
 
Machine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksMachine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural Networks
 
Machine Learning Landscape
Machine Learning LandscapeMachine Learning Landscape
Machine Learning Landscape
 
Machine learning
Machine learningMachine learning
Machine learning
 
Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural Network
 
Supervised Unsupervised and Reinforcement Learning
Supervised Unsupervised and Reinforcement Learning Supervised Unsupervised and Reinforcement Learning
Supervised Unsupervised and Reinforcement Learning
 
Linear regression
Linear regressionLinear regression
Linear regression
 

Similar to Online Machine Learning: introduction and examples

Machine learning For Smarter Manufacturing & its Fundamentals
Machine learning For Smarter Manufacturing & its FundamentalsMachine learning For Smarter Manufacturing & its Fundamentals
Machine learning For Smarter Manufacturing & its FundamentalsSuchitGaikwad
 
PyData SF 2016 --- Moving forward through the darkness
PyData SF 2016 --- Moving forward through the darknessPyData SF 2016 --- Moving forward through the darkness
PyData SF 2016 --- Moving forward through the darknessChia-Chi Chang
 
Overview of machine learning
Overview of machine learning Overview of machine learning
Overview of machine learning SolivarLabs
 
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareThe Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareAndrey Karpov
 
Jay Yagnik at AI Frontiers : A History Lesson on AI
Jay Yagnik at AI Frontiers : A History Lesson on AIJay Yagnik at AI Frontiers : A History Lesson on AI
Jay Yagnik at AI Frontiers : A History Lesson on AIAI Frontiers
 
Module 7: Unsupervised Learning
Module 7:  Unsupervised LearningModule 7:  Unsupervised Learning
Module 7: Unsupervised LearningSara Hooker
 
Machine-Learning-Overview a statistical approach
Machine-Learning-Overview a statistical approachMachine-Learning-Overview a statistical approach
Machine-Learning-Overview a statistical approachAjit Ghodke
 
Machine Learning for (DF)IR with Velociraptor: From Setting Expectations to a...
Machine Learning for (DF)IR with Velociraptor: From Setting Expectations to a...Machine Learning for (DF)IR with Velociraptor: From Setting Expectations to a...
Machine Learning for (DF)IR with Velociraptor: From Setting Expectations to a...Chris Hammerschmidt
 
Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
Strata 2016 -  Lessons Learned from building real-life Machine Learning SystemsStrata 2016 -  Lessons Learned from building real-life Machine Learning Systems
Strata 2016 - Lessons Learned from building real-life Machine Learning SystemsXavier Amatriain
 
Optimization of power systems - old and new tools
Optimization of power systems - old and new toolsOptimization of power systems - old and new tools
Optimization of power systems - old and new toolsOlivier Teytaud
 
Tools for Discrete Time Control; Application to Power Systems
Tools for Discrete Time Control; Application to Power SystemsTools for Discrete Time Control; Application to Power Systems
Tools for Discrete Time Control; Application to Power SystemsOlivier Teytaud
 
Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...
Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...
Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...Alok Singh
 
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough data
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough dataВладимир Гулин, Mail.Ru Group, Learning to rank using clickthrough data
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough dataMail.ru Group
 
"What we learned from 5 years of building a data science software that actual...
"What we learned from 5 years of building a data science software that actual..."What we learned from 5 years of building a data science software that actual...
"What we learned from 5 years of building a data science software that actual...Dataconomy Media
 
Cs854 lecturenotes01
Cs854 lecturenotes01Cs854 lecturenotes01
Cs854 lecturenotes01Mehmet Çelik
 
CSE545 sp23 (2) Streaming Algorithms 2-4.pdf
CSE545 sp23 (2) Streaming Algorithms 2-4.pdfCSE545 sp23 (2) Streaming Algorithms 2-4.pdf
CSE545 sp23 (2) Streaming Algorithms 2-4.pdfAlexanderKyalo3
 
Primer to Machine Learning
Primer to Machine LearningPrimer to Machine Learning
Primer to Machine LearningJeff Tanner
 

Similar to Online Machine Learning: introduction and examples (20)

Machine learning For Smarter Manufacturing & its Fundamentals
Machine learning For Smarter Manufacturing & its FundamentalsMachine learning For Smarter Manufacturing & its Fundamentals
Machine learning For Smarter Manufacturing & its Fundamentals
 
PyData SF 2016 --- Moving forward through the darkness
PyData SF 2016 --- Moving forward through the darknessPyData SF 2016 --- Moving forward through the darkness
PyData SF 2016 --- Moving forward through the darkness
 
Overview of machine learning
Overview of machine learning Overview of machine learning
Overview of machine learning
 
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareThe Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
 
Jay Yagnik at AI Frontiers : A History Lesson on AI
Jay Yagnik at AI Frontiers : A History Lesson on AIJay Yagnik at AI Frontiers : A History Lesson on AI
Jay Yagnik at AI Frontiers : A History Lesson on AI
 
Module 7: Unsupervised Learning
Module 7:  Unsupervised LearningModule 7:  Unsupervised Learning
Module 7: Unsupervised Learning
 
Pycon 2012 Scikit-Learn
Pycon 2012 Scikit-LearnPycon 2012 Scikit-Learn
Pycon 2012 Scikit-Learn
 
Machine-Learning-Overview a statistical approach
Machine-Learning-Overview a statistical approachMachine-Learning-Overview a statistical approach
Machine-Learning-Overview a statistical approach
 
Machine Learning for (DF)IR with Velociraptor: From Setting Expectations to a...
Machine Learning for (DF)IR with Velociraptor: From Setting Expectations to a...Machine Learning for (DF)IR with Velociraptor: From Setting Expectations to a...
Machine Learning for (DF)IR with Velociraptor: From Setting Expectations to a...
 
Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
Strata 2016 -  Lessons Learned from building real-life Machine Learning SystemsStrata 2016 -  Lessons Learned from building real-life Machine Learning Systems
Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
 
Optimization of power systems - old and new tools
Optimization of power systems - old and new toolsOptimization of power systems - old and new tools
Optimization of power systems - old and new tools
 
Tools for Discrete Time Control; Application to Power Systems
Tools for Discrete Time Control; Application to Power SystemsTools for Discrete Time Control; Application to Power Systems
Tools for Discrete Time Control; Application to Power Systems
 
Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...
Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...
Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...
 
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough data
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough dataВладимир Гулин, Mail.Ru Group, Learning to rank using clickthrough data
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough data
 
daa unit 1.pptx
daa unit 1.pptxdaa unit 1.pptx
daa unit 1.pptx
 
"What we learned from 5 years of building a data science software that actual...
"What we learned from 5 years of building a data science software that actual..."What we learned from 5 years of building a data science software that actual...
"What we learned from 5 years of building a data science software that actual...
 
Cs854 lecturenotes01
Cs854 lecturenotes01Cs854 lecturenotes01
Cs854 lecturenotes01
 
CSE545 sp23 (2) Streaming Algorithms 2-4.pdf
CSE545 sp23 (2) Streaming Algorithms 2-4.pdfCSE545 sp23 (2) Streaming Algorithms 2-4.pdf
CSE545 sp23 (2) Streaming Algorithms 2-4.pdf
 
OR Ndejje Univ.pptx
OR Ndejje Univ.pptxOR Ndejje Univ.pptx
OR Ndejje Univ.pptx
 
Primer to Machine Learning
Primer to Machine LearningPrimer to Machine Learning
Primer to Machine Learning
 

More from Felipe

Aula rotulação automática - Automatic tagging
Aula rotulação automática - Automatic taggingAula rotulação automática - Automatic tagging
Aula rotulação automática - Automatic taggingFelipe
 
First steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFirst steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFelipe
 
Word embeddings introdução, motivação e exemplos
Word embeddings  introdução, motivação e exemplosWord embeddings  introdução, motivação e exemplos
Word embeddings introdução, motivação e exemplosFelipe
 
Cloud Certifications - Overview
Cloud Certifications - OverviewCloud Certifications - Overview
Cloud Certifications - OverviewFelipe
 
Elasticsearch for Data Analytics
Elasticsearch for Data AnalyticsElasticsearch for Data Analytics
Elasticsearch for Data AnalyticsFelipe
 
Cloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and AlarmsCloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and AlarmsFelipe
 
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsCloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsFelipe
 
Aws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and toolsAws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and toolsFelipe
 
Exemplos de uso de apache spark usando aws elastic map reduce
Exemplos de uso de apache spark usando aws elastic map reduceExemplos de uso de apache spark usando aws elastic map reduce
Exemplos de uso de apache spark usando aws elastic map reduceFelipe
 
Pré processamento de grandes dados com Apache Spark
Pré processamento de grandes dados com Apache SparkPré processamento de grandes dados com Apache Spark
Pré processamento de grandes dados com Apache SparkFelipe
 
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...Felipe
 
Boas práticas no desenvolvimento de software
Boas práticas no desenvolvimento de softwareBoas práticas no desenvolvimento de software
Boas práticas no desenvolvimento de softwareFelipe
 
Rachinations
RachinationsRachinations
RachinationsFelipe
 
Ausgewählte preußische Tugenden
Ausgewählte preußische TugendenAusgewählte preußische Tugenden
Ausgewählte preußische TugendenFelipe
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play frameworkFelipe
 
Conceitos e exemplos em versionamento de código
Conceitos e exemplos em versionamento de códigoConceitos e exemplos em versionamento de código
Conceitos e exemplos em versionamento de códigoFelipe
 
DevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementDevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementFelipe
 
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantDevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantFelipe
 
D3.js 30-minute intro
D3.js   30-minute introD3.js   30-minute intro
D3.js 30-minute introFelipe
 

More from Felipe (19)

Aula rotulação automática - Automatic tagging
Aula rotulação automática - Automatic taggingAula rotulação automática - Automatic tagging
Aula rotulação automática - Automatic tagging
 
First steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFirst steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with Examples
 
Word embeddings introdução, motivação e exemplos
Word embeddings  introdução, motivação e exemplosWord embeddings  introdução, motivação e exemplos
Word embeddings introdução, motivação e exemplos
 
Cloud Certifications - Overview
Cloud Certifications - OverviewCloud Certifications - Overview
Cloud Certifications - Overview
 
Elasticsearch for Data Analytics
Elasticsearch for Data AnalyticsElasticsearch for Data Analytics
Elasticsearch for Data Analytics
 
Cloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and AlarmsCloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and Alarms
 
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsCloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
 
Aws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and toolsAws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and tools
 
Exemplos de uso de apache spark usando aws elastic map reduce
Exemplos de uso de apache spark usando aws elastic map reduceExemplos de uso de apache spark usando aws elastic map reduce
Exemplos de uso de apache spark usando aws elastic map reduce
 
Pré processamento de grandes dados com Apache Spark
Pré processamento de grandes dados com Apache SparkPré processamento de grandes dados com Apache Spark
Pré processamento de grandes dados com Apache Spark
 
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
 
Boas práticas no desenvolvimento de software
Boas práticas no desenvolvimento de softwareBoas práticas no desenvolvimento de software
Boas práticas no desenvolvimento de software
 
Rachinations
RachinationsRachinations
Rachinations
 
Ausgewählte preußische Tugenden
Ausgewählte preußische TugendenAusgewählte preußische Tugenden
Ausgewählte preußische Tugenden
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
 
Conceitos e exemplos em versionamento de código
Conceitos e exemplos em versionamento de códigoConceitos e exemplos em versionamento de código
Conceitos e exemplos em versionamento de código
 
DevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementDevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration management
 
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantDevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
 
D3.js 30-minute intro
D3.js   30-minute introD3.js   30-minute intro
D3.js 30-minute intro
 

Recently uploaded

Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 

Recently uploaded (20)

Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 

Online Machine Learning: introduction and examples

  • 1. Online Learning Felipe Almeida Rio Machine Learning Meetup August / 2016 Introduction, overview and examples
  • 2. Structure ● Introduction ● Use cases ● Types of Targets ● Approaches ● Current Trends / Related Areas ● Links 2
  • 3. Introduction ● Online Learning is generally described as doing machine learning in a streaming data setting, i.e. training a model in consecutive rounds 3
  • 4. Introduction ● Online Learning is generally described as doing machine learning in a streaming data setting, i.e. training a model in consecutive rounds ○ At the beginning of each round the algorithm is presented with an input sample, and must perform a prediction 4
  • 5. Introduction ● Online Learning is generally described as doing machine learning in a streaming data setting, i.e. training a model in consecutive rounds ○ At the beginning of each round the algorithm is presented with an input sample, and must perform a prediction ○ The algorithm verifies whether its prediction was correct or incorrect, and feeds this information back into the model, for subsequent rounds 5
  • 6. Introduction 6 Whereas in batch (or offline) learning you have access to the whole dataset to train on x1 x2 x3 ... xd y x1 x2 x3 ... xd y x1 x2 x3 ... xd y x1 x2 x3 ... xd y x1 x2 x3 ... xd y D features Nsamples Trained model Batch training
  • 7. Introduction 7 In online learning your model evolves as you see new data, one example at a time x1 x2 x3 ... xd y Timeincreases Input data at time t Online update model at time t x1 x2 x3 ... xd y Input data at time t+1 Online update model at time t+1 x1 x2 x3 ... xd y Input data at time t+2 Online update model at time t+2
  • 8. Introduction ● In other words, you need to answer a sequence of questions but you only have access to answers to previous questions 8
  • 9. Introduction ● In other words, you need to answer a sequence of questions but you only have access to answers to previous questions 9 Adapted from Shalev-Shwartz 2012
  • 10. Introduction ● In other words, you need to answer a sequence of questions but you only have access to answers to previous questions 10 Each t represents a trial Adapted from Shalev-Shwartz 2012
  • 11. Introduction ● In other words, you need to answer a sequence of questions but you only have access to answers to previous questions 11 Each t represents a trial Adapted from Shalev-Shwartz 2012 xt is the input data for trial t
  • 12. Introduction ● In other words, you need to answer a sequence of questions but you only have access to answers to previous questions 12 Each t represents a trial Adapted from Shalev-Shwartz 2012 xt is the input data for trial t pt is the prediction for the label corresponding to xt
  • 13. Introduction ● In other words, you need to answer a sequence of questions but you only have access to answers to previous questions 13 Each t represents a trial Adapted from Shalev-Shwartz 2012 xt is the input data for trial t pt is the prediction for the label corresponding to xt This is the difference between what you predicted and the actual label
  • 14. Introduction ● In other words, you need to answer a sequence of questions but you only have access to answers to previous questions 14 Each t represents a trial xt is the input data for trial t pt is the prediction for the label corresponding to xt This is the difference between what you predicted and the actual label After computing the loss, the algorithm will use this information to update the model generating the predictions for the next trials
  • 15. Introduction: Main Concepts The main objective of online learning algorithms is to minimize the regret. 15
  • 16. Introduction: Main Concepts The main objective of online learning algorithms is to minimize the regret. The regret is the difference between the performance of: ● the online algorithm ● an ideal algorithm that has been able to train on the whole data seen so far, in batch fashion 16
  • 17. Introduction: Main Concepts In other words, the main objective of an online machine learning algorithm is to try to perform as closely to the corresponding offline algorithm as possible. 17
  • 18. Introduction: Main Concepts In other words, the main objective of an online machine learning algorithm is to try to perform as closely to the corresponding offline algorithm as possible. This is measured by the regret. 18
  • 19. Use cases ● Online algorithms are useful in at least two scenarios: 19
  • 20. Use cases ● Online algorithms are useful in at least two scenarios: ● When your data is too large to fit in the memory ○ So you need to train your model one example at a time 20
  • 21. Use cases ● Online algorithms are useful in at least two scenarios: ● When your data is too large to fit in the memory ○ So you need to train your model one example at a time ● When new data is constantly being generated, and/or is dependent upon time 21
  • 22. Use cases Some cases where data is constantly being generated and you need quick predictions: 22
  • 23. Use cases Some cases where data is constantly being generated and you need quick predictions: ● Real-time Recommendation ● Fraud Detection ● Spam detection ● Portfolio Selection ● Online ad placement 23
  • 24. Types of Targets There are two main ways to think about an online learning problem, as far as the target functions (that we are trying to learn) are concerned: 24
  • 25. Types of Targets There are two main ways to think about an online learning problem, as far as the target functions (that we are trying to learn) are concerned: ● Stationary Targets ○ The target function you are trying to learn does not change over time (but may be stochastic) 25
  • 26. Types of Targets There are two main ways to think about an online learning problem, as far as the target functions (that we are trying to learn) are concerned: ● Stationary Targets ○ The target function you are trying to learn does not change over time (but may be stochastic) ● Dynamic Targets ○ The process that is generating input sample data is assumed to be non-stationary (i.e. may change over time) ○ The process may even be adapting to your model (i.e. in an adversarial manner) 26
  • 27. Example I: Stationary Targets For stationary targets, the input-generating process is a single, but unknown, function of the attributes. 27
  • 28. Example I: Stationary Targets For stationary targets, the input-generating process is a single, but unknown, function of the attributes. ● Ex.: Some process generates, at each time step t, inputs of the form (x1 , x2 , x3 ) where each attribute is a bit, and the label y is the result of (x1 v (x2 ^ x3 )): 28
  • 29. Example I: Stationary Targets For stationary targets, the input-generating process is a single, but unknown, function of the attributes. ● Ex.: Some process generates, at each time step t, inputs of the form (x1 , x2 , x3 ) where each attribute is a bit, and the label y is the result of (x1 v (x2 ^ x3 )): 29 1 0 1 1 0 1 1 1 0 0 0 0 1 0 0 1 Input at time t Input at time t+1 Input at time t+2 Input at time t+3 x1 x2 x3 y
  • 30. Example I: Stationary Targets For stationary targets, the input-generating process is a single, but unknown, function of the attributes. ● Ex.: Some process generates, at each time step t, inputs of the form (x1 , x2 , x3 ) where each attribute is a bit, and the label y is the result of (x1 v (x2 ^ x3 )): 30 1 0 1 1 0 1 1 1 0 0 0 0 1 0 0 1 Input at time t Input at time t+1 Input at time t+2 Input at time t+3 x1 x2 x3 y From the point of view of the online learning algorithm, obviously!
  • 31. Example II: Dynamic Targets Spam filtering The objective of a good spam filter is to accurately model the following function: 31
  • 32. Example II: Dynamic Targets Spam filtering The objective of a good spam filter is to accurately model the following function: 32 x1 x2 x3 x4 ... xd {0,1}
  • 33. Example II: Dynamic Targets Spam filtering The objective of a good spam filter is to accurately model the following function: 33 Features extracted from an e-mail Spam or not spam? model x1 x2 x3 x4 ... xd {0,1}
  • 34. Example II: Dynamic Targets Spam filtering ● So suppose you have learned that the presence of the word “Dollars” implies that an e-mail is likely spam. 34
  • 35. Example II: Dynamic Targets Spam filtering ● So suppose you have learned that the presence of the word “Dollars” implies that an e-mail is likely spam. ● Spammers have noticed that their scammy e-mails are falling prey to spam filters so they change tactics: 35
  • 36. Example II: Dynamic Targets Spam filtering ● So suppose you have learned that the presence of the word “Dollars” implies that an e-mail is likely spam. ● Spammers have noticed that their scammy e-mails are falling prey to spam filters so they change tactics: ○ So instead of using the word “Dollars” they start using the word “Euro”, which fools your filter but also accomplishes their goal (have people read the e-mail) 36
  • 37. Approaches A couple of approaches have been proposed in the literature: ● Online Learning from Expert Advice 37
  • 38. Approaches A couple of approaches have been proposed in the literature: ● Online Learning from Expert Advice ● Online Learning from Examples 38
  • 39. Approaches A couple of approaches have been proposed in the literature: ● Online Learning from Expert Advice ● Online Learning from Examples ● General algorithms that may also be used in the online setting 39
  • 40. Approaches: Expert Advice In this approach, it is assumed that the algorithm has multiple oracles (or experts at its disposal), which its can use to produce its output, in each trial. 40
  • 41. Approaches: Expert Advice In this approach, it is assumed that the algorithm has multiple oracles (or experts at its disposal), which its can use to produce its output, in each trial. In other words, the task of this online algorithm is simply to learn which of the experts it should use. 41
  • 42. Approaches: Expert Advice In this approach, it is assumed that the algorithm has multiple oracles (or experts at its disposal), which its can use to produce its output, in each trial. In other words, the task of this online algorithm is simply to learn which of the experts it should use. The simplest algorithm in this realm is the Randomized Weighted Majority Algorithm 42
  • 43. Approaches: Expert Advice Randomized Weighted Majority Algorithm ● Every expert has a weight (starting at 1) ● For every trial: ○ Randomly select an expert (larger weight => more likely) ○ Use that expert’s output as your prediction ○ Verify the correct answer ○ For each expert: ■ If it was mistaken, decrease its weight by a constant factor 43
  • 44. Approaches: Learning from Examples Learning from examples is different from using Expert Advice inasmuch as we don’t need to previously define prebuild experts we will derive our predictions from. 44
  • 45. Approaches: Learning from Examples Learning from examples is different from using Expert Advice inasmuch as we don’t need to previously define prebuild experts we will derive our predictions from. We need, however, to know what Concept Class we want to search over. 45
  • 46. Approaches: Learning from Examples A Concept Class is a set of of functions (concepts) that subscribe to a particular model. 46
  • 47. Approaches: Learning from Examples A Concept Class is a set of of functions (concepts) that subscribe to a particular model. Some examples of concept classes are: ● The set of all monotone disjunctions of N variables ● The set of non-monotone disjunctions of N variables ● Decision lists with N variables ● Linear threshold formulas ● DNF (disjunctive normal form) formulas 47
  • 48. Approaches: Learning from Examples The Winnow Algorithm is one example of a simple algorithm that learns monotone disjunctions online. 48
  • 49. Approaches: Learning from Examples The Winnow Algorithm is one example of a simple algorithm that learns monotone disjunctions online. In other words, it learns any concept (function), provided the concept belongs to the Concept Class of monotone disjunctions. 49
  • 50. Approaches: Learning from Examples The Winnow Algorithm is one example of a simple algorithm that learns monotone disjunctions online. In other words, it learns any concept (function), provided the concept belongs to the Concept Class of monotone disjunctions. It also uses weights, as in the previous example. 50
  • 51. Approaches: Learning from Examples Winnow algorithm ● Initialize all weights (w1 , w2 ,... wn ) to 1 ● Given a new example: ○ Predict 1 if wT x > n ○ Predict 0 otherwise ● Check the true answer ● For each input attribute: ○ If algorithm predicted 1 but true answer was 0, double the value of every weight corresponding to an attribute = 1 ○ If algorithm predicted 0 but true answer was 1, halve the value of each weight corresponding to an attribute = 0 51
  • 52. Approaches: Learning from Examples Winnow algorithm ● Initialize all weights (w1 , w2 ,... wn ) to 1 ● Given a new example: ○ Predict 1 if wT x > n ○ Predict 0 otherwise ● Check the true answer ● For each input attribute: ○ If algorithm predicted 1 but true answer was 0, double the value of every weight corresponding to an attribute = 1 ○ If algorithm predicted 0 but true answer was 1, halve the value of each weight corresponding to an attribute = 0 52 We aimed too low, let’s try to make our guess higher
  • 53. Approaches: Learning from Examples Winnow algorithm ● Initialize all weights (w1 , w2 ,... wn ) to 1 ● Given a new example: ○ Predict 1 if wT x > n ○ Predict 0 otherwise ● Check the true answer ● For each input attribute: ○ If algorithm predicted 1 but true answer was 0, double the value of every weight corresponding to an attribute = 1 ○ If algorithm predicted 0 but true answer was 1, halve the value of each weight corresponding to an attribute = 0 53 We aimed too high, let’s try to make our guess lower
  • 54. Approaches: Other Approaches More general algorithms can also be used in an online setting, such as: 54
  • 55. Approaches: Other Approaches More general algorithms can also be used in an online setting, such as: ● Stochastic Gradient Descent 55
  • 56. Approaches: Other Approaches More general algorithms can also be used in an online setting, such as: ● Stochastic Gradient Descent ● Perceptron Learning Algorithm 56
  • 57. Current Trends / Related Areas Adversarial Machine Learning ● Refers to scenarios where your input-generating process is an adaptive adversary ● Applications in: ○ Information Security ○ Games 57
  • 58. Current Trends / Related Areas One-shot Learning ● Refers to scenarios where your must perform predictions after seeing just a few, or even a single input sample ● Applications in: ○ Computer Vision 58
  • 59. Links ● http://ttic.uchicago.edu/~shai/papers/ShalevThesis07.pdf ● Blum 1998 Survey Paper ● UofW CSE599S Online Learning ● Machine Learning From Streaming data ● Twitter Fighting Spam with BotMaker ● CS229 - Online Learning Lecture ● Building a real time Recommendation Engine with Data Science ● Online Optimization for Large Scale Machine Learning by prof A. Banerjee ● Learning, Regret, Minimization and Equilibria 59
  • 60. Links ● https://github.com/JohnLangford/vowpal_wabbit ● Shai Shalev-Shwartz 2011 Survey Paper ● Hoi et al 2014 - LIBOL ● MIT 6.883 Online Methods in Machine Learning 60