SlideShare a Scribd company logo
Wapid and wobust active online machine leawning with Vowpal Wabbit 
Pycon Finland 2014, Helsinki 
2014-10-27 
Antti Haapala 
antti@anttipatterns.com
Disclaimer 
● IANAS – I Am Not A Statistician 
● I researched the principles on how this works 
for this presentation
Why did I start to do ML? 
● Task 
– Receive social media content from various sources 
– Filter out all messages that are not in English, are press 
releases or outright spam. 
● Easy, when you can hire a team of people for just this task... 
● But people are expensive compared to computers... 
– And filtering messages is tedious work 
● Clearly a little machine learning could help us to 
separate the spam from sausage, eggs and ham.
Time to code 
● Write a binary classifier 
● But with what? 
– How does one even do it?
Libraries: Scikit-Learn 
● NLTK 
– Has some pure Python classifier implementations 
– These algorithms require all data in memory 
– The speed is an issue here 
● Some of them are too slow 
● The rest are even slower
Libraries: Scikit-Learn 
● Scikit-Learn 
– Better than NLTK 
– Though most algorithms require all data in memory 
● And our data still does not fit 
– There are some out-of-core algorithms yes, but 
they're not clearly documented 
– Still slow - we cannot afford to reevaluate our 
classifiers for hours...
Possible libraries 
● How about FANN, Orange, PyMC, PyML, 
LIBSVM, PyBrain, ffnet, MDP, Shogun toolbox, 
Theano, mlpy, Elefant, Bayes Blocks, Monte 
Python, hcluster, Plearn, Pycplex, pymorph....
????
Asking does not hurt 
“Have you tried using Vowpal Wabbit?” 
“Vowwhat?” 
“Vowpal Wabbit”
What is Vowpal Wabbit? 
A research project with the most Pythonic name 
ever
The name
What is Vowpal Wabbit? 
• John Langford: I'd like to solve AI. 
• Interviewer: How? 
• John: I want to use parallel learning algorithms 
to create fantastic learning machines!
What is Vowpal Wabbit? 
“VW is the essence of speed in machine learning, 
able to learn from terafeature datasets with ease.”
What is Vowpal Wabbit? 
“Via parallel learning, it can exceed the 
throughput of any single machine network 
interface when doing linear learning, a first 
amongst learning algorithms.”
Built for speed and scalability 
● “Plausibly the most scalable public linear 
learner, and plausibly the most scalable 
anywhere” 
● Excels on the network though impressive 
performance even on a single node.
Vowpal Wabbit compared to scikit-learn 
The algorithms where the cheatsheet says “> 
100k samples”
Scalability 
● Find a good linear predictor 
f w (x )=Σi 
– For 2,100,000,000,000 features... 
– 17,000,000,000 examples... 
– 16,000,000 parameters... 
– Using 1,000 nodes... 
wi xi 
● Finished in 70 minutes, at 500M features per second 
● That was years ago, using the then stock build of 
VW.
Open Source 
● Vowpal Wabbit is open source, under BSD 
license 
● Exists even in Ubuntu universe repository 
● The project was started by Yahoo Research, 
currently under Microsoft Research. 
– So even Windows will be supported...
Sparse Stochastic 
Gradient Descent 
● Maps all inputs to n-dimensional space 
● And divides the space by one hyperplane 
minimizing the loss caused by wrong 
classification 
– One class is on one side of the plane 
– The other is on the other side of the plane 
– The loss is modeled by a loss function
Stochastic Gradient Descent 
Image from Scikit-Learn
Which loss function for a classifier? 
● Crash course in statistics: 
– “It helps if you understand the data” 
– “But if you don't then try logistic regression” 
– Thus go for the logistic loss function
Multiclass classifier 
● Vowpal Wabbit supports various methods for 
multiclass classification, read on documentation 
how to use them.
Least squares regression 
● The gradient descent algorithm can also be used 
for regression, for example using the “squared” 
loss function for least squares. 
● A regression predicts the real number value for 
the input that is dependent on the given features 
● A classifier gives a class for the input, and 
possibly the probability for input belonging to that 
class
Classifier output 
in logistic regression 
● With Vowpal Wabbit the prediction value given 
by a classifier with logistic loss is in range [-50, 
50] 
● You can map this to a binary probability using 
the logistic function
From prediction to probability 
p= 
1 
1+e−x
Common practices of machine 
learning 
● Reduce the number of features by hand 
guessing which features are relevant 
● Use non-linear approaches such as the kernel 
trick 
● Map your features to integers 
● Leave your computer on at night to build the 
model from your training data
... become don'ts 
● Reduce the number of features by hand 
guessing which features are relevant 
● Use non-linear approaches such as the kernel 
trick 
● Map your features to integers 
● Leave your workstation on at night to build the 
model from your training data
Reduce the number of features 
● Vowpal Wabbit can handle sparse featuresets 
having millions of features efficiently
Use non-linear approaches 
● Sparse dataset with many dimensions yields 
comparative results to using fewer features with 
kernel tricks 
● One can ask Vowpal Wabbit to generate new 
features as the Cartesian product of existing 
features, using namespaces: 
– That is, given features u^a, u^b, v^c, and v^d, by 
using command line parameter -q uv, VW can make 
u^a^v^c and so forth.
Map your features to integers 
● Vowpal Wabbit hashes feature names to 
integers internally using Murmur hash v3 
● The downside of hashing are the possible 
collisions for too many features 
– H(“Nigerian prince”) = H(“job interview”) 
● Though it also decreases the possibility of 
overfitting
Fit the model at night 
● Vowpal Wabbit supports online and active 
learning. 
● Most learning tasks are IO-, not CPU-bound 
● That is to mean, your feature extraction code 
will be the bottleneck.
Supervised Learning 
● Training 
Label 
Input FFeeaatuturree e exxtrtraacctotorr Features 
● Prediction 
Machine 
Learning 
algorithm 
Machine 
Learning 
algorithm 
Input FFeeaatuturree e exxtrtraacctotorr Features 
MMooddeell 
Label
Offline vs Online learning 
● In offline learning the model is fed all the input, after 
which it is finalized; the finalized model will be used for 
predictions 
– That is, teach the classifier all kinds of unwanted messages 
before actual use, and use the resulting classifier for 10 years. 
→ Certainly not going to work. 
● In online learning, the model can be used for predictions 
right after the first input 
– The model will gradually converge towards better classification
Semisupervised learning – active 
learning 
● Asking for input for classifier is expensive 
– If one asks to label all given examples, it is almost 
even worse as not asking at all 
● The solution is active learning
Active learning 
● Train only if importance >= threshold 
Label 
Input FFeeaatuturree e exxtrtraacctotorr Features 
Machine 
Learning 
algorithm 
Machine 
Learning 
algorithm 
● Prediction 
Input FFeeaatuturree e exxtrtraacctotorr Features 
MMooddeell 
Label 
Importance
How to use Vowpal Wabbit 
● You can use it on the command line. To teach a 
model using logistic regression: 
% cat train.txt 
-1 |t nigerian prince offers money ... |a user@example.com 
1 |t invite job interview ... |a boss@dreamco.com 
... 
% vw -d train.txt --loss_function=logistic -f model.vw 
● To test 
% vw -i model.vw --loss_function=logistic -p /dev/stdout 
|t nigerian prince interview 
-0.145824 
|t spam ham and eggs |a boss@dreamco.com 
0.134225
How to use VW in Python 
● Multiple libraries exist 
– Though none of the APIs are to my liking 
– So I wrote my own 
from caerbannog import Rabbit
Examples in Python
Thanks 
Questions?

More Related Content

What's hot

Modern classification techniques
Modern classification techniquesModern classification techniques
Modern classification techniques
mark_landry
 
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Universitat Politècnica de Catalunya
 
Sergei Vassilvitskii, Research Scientist, Google at MLconf NYC - 4/15/16
Sergei Vassilvitskii, Research Scientist, Google at MLconf NYC - 4/15/16Sergei Vassilvitskii, Research Scientist, Google at MLconf NYC - 4/15/16
Sergei Vassilvitskii, Research Scientist, Google at MLconf NYC - 4/15/16
MLconf
 
Andrew Musselman, Committer and PMC Member, Apache Mahout, at MLconf Seattle ...
Andrew Musselman, Committer and PMC Member, Apache Mahout, at MLconf Seattle ...Andrew Musselman, Committer and PMC Member, Apache Mahout, at MLconf Seattle ...
Andrew Musselman, Committer and PMC Member, Apache Mahout, at MLconf Seattle ...
MLconf
 
Parallel External Memory Algorithms Applied to Generalized Linear Models
Parallel External Memory Algorithms Applied to Generalized Linear ModelsParallel External Memory Algorithms Applied to Generalized Linear Models
Parallel External Memory Algorithms Applied to Generalized Linear Models
Revolution Analytics
 
Alex Smola, Director of Machine Learning, AWS/Amazon, at MLconf SF 2016
Alex Smola, Director of Machine Learning, AWS/Amazon, at MLconf SF 2016Alex Smola, Director of Machine Learning, AWS/Amazon, at MLconf SF 2016
Alex Smola, Director of Machine Learning, AWS/Amazon, at MLconf SF 2016
MLconf
 
Anima Anadkumar, Principal Scientist, Amazon Web Services, Endowed Professor,...
Anima Anadkumar, Principal Scientist, Amazon Web Services, Endowed Professor,...Anima Anadkumar, Principal Scientist, Amazon Web Services, Endowed Professor,...
Anima Anadkumar, Principal Scientist, Amazon Web Services, Endowed Professor,...
MLconf
 
Scaling out logistic regression with Spark
Scaling out logistic regression with SparkScaling out logistic regression with Spark
Scaling out logistic regression with Spark
Barak Gitsis
 
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
MLconf
 
Distributed implementation of a lstm on spark and tensorflow
Distributed implementation of a lstm on spark and tensorflowDistributed implementation of a lstm on spark and tensorflow
Distributed implementation of a lstm on spark and tensorflow
Emanuel Di Nardo
 
Melanie Warrick, Deep Learning Engineer, Skymind.io at MLconf SF - 11/13/15
Melanie Warrick, Deep Learning Engineer, Skymind.io at MLconf SF - 11/13/15Melanie Warrick, Deep Learning Engineer, Skymind.io at MLconf SF - 11/13/15
Melanie Warrick, Deep Learning Engineer, Skymind.io at MLconf SF - 11/13/15
MLconf
 
Deep Learning in theano
Deep Learning in theanoDeep Learning in theano
Deep Learning in theano
Massimo Quadrana
 
An Introduction to TensorFlow architecture
An Introduction to TensorFlow architectureAn Introduction to TensorFlow architecture
An Introduction to TensorFlow architecture
Mani Goswami
 
Generating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in juliaGenerating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in julia
Andre Pemmelaar
 
Deep_Learning_Frameworks_CNTK_PyTorch
Deep_Learning_Frameworks_CNTK_PyTorchDeep_Learning_Frameworks_CNTK_PyTorch
Deep_Learning_Frameworks_CNTK_PyTorch
Subhashis Hazarika
 
Deep Learning in Python with Tensorflow for Finance
Deep Learning in Python with Tensorflow for FinanceDeep Learning in Python with Tensorflow for Finance
Deep Learning in Python with Tensorflow for Finance
Ben Ball
 
Numba
NumbaNumba
Multinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache SparkMultinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache Spark
DB Tsai
 
Introduction to theano, case study of Word Embeddings
Introduction to theano, case study of Word EmbeddingsIntroduction to theano, case study of Word Embeddings
Introduction to theano, case study of Word Embeddings
Shashank Gupta
 
Generalized Linear Models in Spark MLlib and SparkR
Generalized Linear Models in Spark MLlib and SparkRGeneralized Linear Models in Spark MLlib and SparkR
Generalized Linear Models in Spark MLlib and SparkR
Databricks
 

What's hot (20)

Modern classification techniques
Modern classification techniquesModern classification techniques
Modern classification techniques
 
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
 
Sergei Vassilvitskii, Research Scientist, Google at MLconf NYC - 4/15/16
Sergei Vassilvitskii, Research Scientist, Google at MLconf NYC - 4/15/16Sergei Vassilvitskii, Research Scientist, Google at MLconf NYC - 4/15/16
Sergei Vassilvitskii, Research Scientist, Google at MLconf NYC - 4/15/16
 
Andrew Musselman, Committer and PMC Member, Apache Mahout, at MLconf Seattle ...
Andrew Musselman, Committer and PMC Member, Apache Mahout, at MLconf Seattle ...Andrew Musselman, Committer and PMC Member, Apache Mahout, at MLconf Seattle ...
Andrew Musselman, Committer and PMC Member, Apache Mahout, at MLconf Seattle ...
 
Parallel External Memory Algorithms Applied to Generalized Linear Models
Parallel External Memory Algorithms Applied to Generalized Linear ModelsParallel External Memory Algorithms Applied to Generalized Linear Models
Parallel External Memory Algorithms Applied to Generalized Linear Models
 
Alex Smola, Director of Machine Learning, AWS/Amazon, at MLconf SF 2016
Alex Smola, Director of Machine Learning, AWS/Amazon, at MLconf SF 2016Alex Smola, Director of Machine Learning, AWS/Amazon, at MLconf SF 2016
Alex Smola, Director of Machine Learning, AWS/Amazon, at MLconf SF 2016
 
Anima Anadkumar, Principal Scientist, Amazon Web Services, Endowed Professor,...
Anima Anadkumar, Principal Scientist, Amazon Web Services, Endowed Professor,...Anima Anadkumar, Principal Scientist, Amazon Web Services, Endowed Professor,...
Anima Anadkumar, Principal Scientist, Amazon Web Services, Endowed Professor,...
 
Scaling out logistic regression with Spark
Scaling out logistic regression with SparkScaling out logistic regression with Spark
Scaling out logistic regression with Spark
 
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
 
Distributed implementation of a lstm on spark and tensorflow
Distributed implementation of a lstm on spark and tensorflowDistributed implementation of a lstm on spark and tensorflow
Distributed implementation of a lstm on spark and tensorflow
 
Melanie Warrick, Deep Learning Engineer, Skymind.io at MLconf SF - 11/13/15
Melanie Warrick, Deep Learning Engineer, Skymind.io at MLconf SF - 11/13/15Melanie Warrick, Deep Learning Engineer, Skymind.io at MLconf SF - 11/13/15
Melanie Warrick, Deep Learning Engineer, Skymind.io at MLconf SF - 11/13/15
 
Deep Learning in theano
Deep Learning in theanoDeep Learning in theano
Deep Learning in theano
 
An Introduction to TensorFlow architecture
An Introduction to TensorFlow architectureAn Introduction to TensorFlow architecture
An Introduction to TensorFlow architecture
 
Generating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in juliaGenerating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in julia
 
Deep_Learning_Frameworks_CNTK_PyTorch
Deep_Learning_Frameworks_CNTK_PyTorchDeep_Learning_Frameworks_CNTK_PyTorch
Deep_Learning_Frameworks_CNTK_PyTorch
 
Deep Learning in Python with Tensorflow for Finance
Deep Learning in Python with Tensorflow for FinanceDeep Learning in Python with Tensorflow for Finance
Deep Learning in Python with Tensorflow for Finance
 
Numba
NumbaNumba
Numba
 
Multinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache SparkMultinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache Spark
 
Introduction to theano, case study of Word Embeddings
Introduction to theano, case study of Word EmbeddingsIntroduction to theano, case study of Word Embeddings
Introduction to theano, case study of Word Embeddings
 
Generalized Linear Models in Spark MLlib and SparkR
Generalized Linear Models in Spark MLlib and SparkRGeneralized Linear Models in Spark MLlib and SparkR
Generalized Linear Models in Spark MLlib and SparkR
 

Viewers also liked

No-Bullshit Data Science
No-Bullshit Data ScienceNo-Bullshit Data Science
No-Bullshit Data Science
Domino Data Lab
 
HackerEarth Sourcing Solution
HackerEarth Sourcing SolutionHackerEarth Sourcing Solution
HackerEarth Sourcing Solution
HackerEarth
 
Druva Casestudy - HackerEarth
Druva Casestudy - HackerEarthDruva Casestudy - HackerEarth
Druva Casestudy - HackerEarthHackerEarth
 
6 rules of enterprise innovation
6 rules of enterprise innovation6 rules of enterprise innovation
6 rules of enterprise innovation
HackerEarth
 
State of women in technical workforce
State of women in technical workforceState of women in technical workforce
State of women in technical workforce
HackerEarth
 
Data Science Competition
Data Science CompetitionData Science Competition
Data Science Competition
Jeong-Yoon Lee
 
Menstrual Health Reader - mEo
Menstrual Health Reader - mEoMenstrual Health Reader - mEo
Menstrual Health Reader - mEo
HackerEarth
 
Doing your first Kaggle (Python for Big Data sets)
Doing your first Kaggle (Python for Big Data sets)Doing your first Kaggle (Python for Big Data sets)
Doing your first Kaggle (Python for Big Data sets)
Domino Data Lab
 
Data Science Competition
Data Science CompetitionData Science Competition
Data Science Competition
Jeong-Yoon Lee
 
Managing Data Science | Lessons from the Field
Managing Data Science | Lessons from the Field Managing Data Science | Lessons from the Field
Managing Data Science | Lessons from the Field
Domino Data Lab
 
Leverage Social Media for Employer Brand and Recruiting
Leverage Social Media for Employer Brand and RecruitingLeverage Social Media for Employer Brand and Recruiting
Leverage Social Media for Employer Brand and RecruitingHackerEarth
 
Ethics in Data Science and Machine Learning
Ethics in Data Science and Machine LearningEthics in Data Science and Machine Learning
Ethics in Data Science and Machine Learning
HJ van Veen
 
Leveraged Analytics at Scale
Leveraged Analytics at ScaleLeveraged Analytics at Scale
Leveraged Analytics at Scale
Domino Data Lab
 
Kill the wabbit
Kill the wabbitKill the wabbit
Kill the wabbit
Joe Kleinwaechter
 
Intra company hackathons using HackerEarth
Intra company hackathons using HackerEarthIntra company hackathons using HackerEarth
Intra company hackathons using HackerEarth
HackerEarth
 
Vowpal Wabbit
Vowpal WabbitVowpal Wabbit
Vowpal Wabbit
odsc
 
USC LIGHT Ministry Introduction
USC LIGHT Ministry IntroductionUSC LIGHT Ministry Introduction
USC LIGHT Ministry Introduction
Jeong-Yoon Lee
 
Smart Switchboard: An home automation system
Smart Switchboard: An home automation systemSmart Switchboard: An home automation system
Smart Switchboard: An home automation system
HackerEarth
 
A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language Processing
Ted Xiao
 

Viewers also liked (20)

No-Bullshit Data Science
No-Bullshit Data ScienceNo-Bullshit Data Science
No-Bullshit Data Science
 
HackerEarth Sourcing Solution
HackerEarth Sourcing SolutionHackerEarth Sourcing Solution
HackerEarth Sourcing Solution
 
Druva Casestudy - HackerEarth
Druva Casestudy - HackerEarthDruva Casestudy - HackerEarth
Druva Casestudy - HackerEarth
 
6 rules of enterprise innovation
6 rules of enterprise innovation6 rules of enterprise innovation
6 rules of enterprise innovation
 
State of women in technical workforce
State of women in technical workforceState of women in technical workforce
State of women in technical workforce
 
Data Science Competition
Data Science CompetitionData Science Competition
Data Science Competition
 
Menstrual Health Reader - mEo
Menstrual Health Reader - mEoMenstrual Health Reader - mEo
Menstrual Health Reader - mEo
 
Doing your first Kaggle (Python for Big Data sets)
Doing your first Kaggle (Python for Big Data sets)Doing your first Kaggle (Python for Big Data sets)
Doing your first Kaggle (Python for Big Data sets)
 
Data Science Competition
Data Science CompetitionData Science Competition
Data Science Competition
 
Managing Data Science | Lessons from the Field
Managing Data Science | Lessons from the Field Managing Data Science | Lessons from the Field
Managing Data Science | Lessons from the Field
 
Leverage Social Media for Employer Brand and Recruiting
Leverage Social Media for Employer Brand and RecruitingLeverage Social Media for Employer Brand and Recruiting
Leverage Social Media for Employer Brand and Recruiting
 
Ethics in Data Science and Machine Learning
Ethics in Data Science and Machine LearningEthics in Data Science and Machine Learning
Ethics in Data Science and Machine Learning
 
Leveraged Analytics at Scale
Leveraged Analytics at ScaleLeveraged Analytics at Scale
Leveraged Analytics at Scale
 
Work - LIGHT Ministry
Work - LIGHT MinistryWork - LIGHT Ministry
Work - LIGHT Ministry
 
Kill the wabbit
Kill the wabbitKill the wabbit
Kill the wabbit
 
Intra company hackathons using HackerEarth
Intra company hackathons using HackerEarthIntra company hackathons using HackerEarth
Intra company hackathons using HackerEarth
 
Vowpal Wabbit
Vowpal WabbitVowpal Wabbit
Vowpal Wabbit
 
USC LIGHT Ministry Introduction
USC LIGHT Ministry IntroductionUSC LIGHT Ministry Introduction
USC LIGHT Ministry Introduction
 
Smart Switchboard: An home automation system
Smart Switchboard: An home automation systemSmart Switchboard: An home automation system
Smart Switchboard: An home automation system
 
A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language Processing
 

Similar to Wapid and wobust active online machine leawning with Vowpal Wabbit

Gatling
Gatling Gatling
Gatling
Gaurav Shukla
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
Knoldus Inc.
 
API Design
API DesignAPI Design
API Design
Tim Boudreau
 
PyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningPyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine Learning
Rebecca Bilbro
 
Neural_Programmer_Interpreter
Neural_Programmer_InterpreterNeural_Programmer_Interpreter
Neural_Programmer_InterpreterKaty Lee
 
Apache con big data 2015 - Data Science from the trenches
Apache con big data 2015 - Data Science from the trenchesApache con big data 2015 - Data Science from the trenches
Apache con big data 2015 - Data Science from the trenches
Vinay Shukla
 
FlinkML - Big data application meetup
FlinkML - Big data application meetupFlinkML - Big data application meetup
FlinkML - Big data application meetup
Theodoros Vasiloudis
 
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning InfrastructureML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
Fei Chen
 
Building High Available and Scalable Machine Learning Applications
Building High Available and Scalable Machine Learning ApplicationsBuilding High Available and Scalable Machine Learning Applications
Building High Available and Scalable Machine Learning Applications
Yalçın Yenigün
 
Predictive analytics semi-supervised learning with GANs
Predictive analytics   semi-supervised learning with GANsPredictive analytics   semi-supervised learning with GANs
Predictive analytics semi-supervised learning with GANs
terek47
 
Software + Babies
Software + BabiesSoftware + Babies
Software + Babies
ArangoDB Database
 
Deep Learning Applications (dadada2017)
Deep Learning Applications (dadada2017)Deep Learning Applications (dadada2017)
Deep Learning Applications (dadada2017)
Abhishek Thakur
 
Python ml
Python mlPython ml
Python ml
Shubham Sharma
 
FlinkML: Large Scale Machine Learning with Apache Flink
FlinkML: Large Scale Machine Learning with Apache FlinkFlinkML: Large Scale Machine Learning with Apache Flink
FlinkML: Large Scale Machine Learning with Apache Flink
Theodoros Vasiloudis
 
Adrian Colyer - Keynote: NoSQL matters - NoSQL matters Dublin 2015
Adrian Colyer - Keynote: NoSQL matters - NoSQL matters Dublin 2015Adrian Colyer - Keynote: NoSQL matters - NoSQL matters Dublin 2015
Adrian Colyer - Keynote: NoSQL matters - NoSQL matters Dublin 2015
NoSQLmatters
 
Everything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongEverything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is Wrong
Tim Boudreau
 
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLoveOSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove
NETWAYS
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Igalia
 
programming_tutorial_course_ lesson_1.pptx
programming_tutorial_course_ lesson_1.pptxprogramming_tutorial_course_ lesson_1.pptx
programming_tutorial_course_ lesson_1.pptx
aboma2hawi
 
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
MLconf
 

Similar to Wapid and wobust active online machine leawning with Vowpal Wabbit (20)

Gatling
Gatling Gatling
Gatling
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
 
API Design
API DesignAPI Design
API Design
 
PyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningPyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine Learning
 
Neural_Programmer_Interpreter
Neural_Programmer_InterpreterNeural_Programmer_Interpreter
Neural_Programmer_Interpreter
 
Apache con big data 2015 - Data Science from the trenches
Apache con big data 2015 - Data Science from the trenchesApache con big data 2015 - Data Science from the trenches
Apache con big data 2015 - Data Science from the trenches
 
FlinkML - Big data application meetup
FlinkML - Big data application meetupFlinkML - Big data application meetup
FlinkML - Big data application meetup
 
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning InfrastructureML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
 
Building High Available and Scalable Machine Learning Applications
Building High Available and Scalable Machine Learning ApplicationsBuilding High Available and Scalable Machine Learning Applications
Building High Available and Scalable Machine Learning Applications
 
Predictive analytics semi-supervised learning with GANs
Predictive analytics   semi-supervised learning with GANsPredictive analytics   semi-supervised learning with GANs
Predictive analytics semi-supervised learning with GANs
 
Software + Babies
Software + BabiesSoftware + Babies
Software + Babies
 
Deep Learning Applications (dadada2017)
Deep Learning Applications (dadada2017)Deep Learning Applications (dadada2017)
Deep Learning Applications (dadada2017)
 
Python ml
Python mlPython ml
Python ml
 
FlinkML: Large Scale Machine Learning with Apache Flink
FlinkML: Large Scale Machine Learning with Apache FlinkFlinkML: Large Scale Machine Learning with Apache Flink
FlinkML: Large Scale Machine Learning with Apache Flink
 
Adrian Colyer - Keynote: NoSQL matters - NoSQL matters Dublin 2015
Adrian Colyer - Keynote: NoSQL matters - NoSQL matters Dublin 2015Adrian Colyer - Keynote: NoSQL matters - NoSQL matters Dublin 2015
Adrian Colyer - Keynote: NoSQL matters - NoSQL matters Dublin 2015
 
Everything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongEverything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is Wrong
 
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLoveOSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
 
programming_tutorial_course_ lesson_1.pptx
programming_tutorial_course_ lesson_1.pptxprogramming_tutorial_course_ lesson_1.pptx
programming_tutorial_course_ lesson_1.pptx
 
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
 

Recently uploaded

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 

Recently uploaded (20)

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 

Wapid and wobust active online machine leawning with Vowpal Wabbit

  • 1. Wapid and wobust active online machine leawning with Vowpal Wabbit Pycon Finland 2014, Helsinki 2014-10-27 Antti Haapala antti@anttipatterns.com
  • 2. Disclaimer ● IANAS – I Am Not A Statistician ● I researched the principles on how this works for this presentation
  • 3. Why did I start to do ML? ● Task – Receive social media content from various sources – Filter out all messages that are not in English, are press releases or outright spam. ● Easy, when you can hire a team of people for just this task... ● But people are expensive compared to computers... – And filtering messages is tedious work ● Clearly a little machine learning could help us to separate the spam from sausage, eggs and ham.
  • 4. Time to code ● Write a binary classifier ● But with what? – How does one even do it?
  • 5. Libraries: Scikit-Learn ● NLTK – Has some pure Python classifier implementations – These algorithms require all data in memory – The speed is an issue here ● Some of them are too slow ● The rest are even slower
  • 6. Libraries: Scikit-Learn ● Scikit-Learn – Better than NLTK – Though most algorithms require all data in memory ● And our data still does not fit – There are some out-of-core algorithms yes, but they're not clearly documented – Still slow - we cannot afford to reevaluate our classifiers for hours...
  • 7. Possible libraries ● How about FANN, Orange, PyMC, PyML, LIBSVM, PyBrain, ffnet, MDP, Shogun toolbox, Theano, mlpy, Elefant, Bayes Blocks, Monte Python, hcluster, Plearn, Pycplex, pymorph....
  • 9. Asking does not hurt “Have you tried using Vowpal Wabbit?” “Vowwhat?” “Vowpal Wabbit”
  • 10. What is Vowpal Wabbit? A research project with the most Pythonic name ever
  • 12. What is Vowpal Wabbit? • John Langford: I'd like to solve AI. • Interviewer: How? • John: I want to use parallel learning algorithms to create fantastic learning machines!
  • 13. What is Vowpal Wabbit? “VW is the essence of speed in machine learning, able to learn from terafeature datasets with ease.”
  • 14. What is Vowpal Wabbit? “Via parallel learning, it can exceed the throughput of any single machine network interface when doing linear learning, a first amongst learning algorithms.”
  • 15. Built for speed and scalability ● “Plausibly the most scalable public linear learner, and plausibly the most scalable anywhere” ● Excels on the network though impressive performance even on a single node.
  • 16. Vowpal Wabbit compared to scikit-learn The algorithms where the cheatsheet says “> 100k samples”
  • 17. Scalability ● Find a good linear predictor f w (x )=Σi – For 2,100,000,000,000 features... – 17,000,000,000 examples... – 16,000,000 parameters... – Using 1,000 nodes... wi xi ● Finished in 70 minutes, at 500M features per second ● That was years ago, using the then stock build of VW.
  • 18. Open Source ● Vowpal Wabbit is open source, under BSD license ● Exists even in Ubuntu universe repository ● The project was started by Yahoo Research, currently under Microsoft Research. – So even Windows will be supported...
  • 19. Sparse Stochastic Gradient Descent ● Maps all inputs to n-dimensional space ● And divides the space by one hyperplane minimizing the loss caused by wrong classification – One class is on one side of the plane – The other is on the other side of the plane – The loss is modeled by a loss function
  • 20. Stochastic Gradient Descent Image from Scikit-Learn
  • 21. Which loss function for a classifier? ● Crash course in statistics: – “It helps if you understand the data” – “But if you don't then try logistic regression” – Thus go for the logistic loss function
  • 22. Multiclass classifier ● Vowpal Wabbit supports various methods for multiclass classification, read on documentation how to use them.
  • 23. Least squares regression ● The gradient descent algorithm can also be used for regression, for example using the “squared” loss function for least squares. ● A regression predicts the real number value for the input that is dependent on the given features ● A classifier gives a class for the input, and possibly the probability for input belonging to that class
  • 24. Classifier output in logistic regression ● With Vowpal Wabbit the prediction value given by a classifier with logistic loss is in range [-50, 50] ● You can map this to a binary probability using the logistic function
  • 25. From prediction to probability p= 1 1+e−x
  • 26. Common practices of machine learning ● Reduce the number of features by hand guessing which features are relevant ● Use non-linear approaches such as the kernel trick ● Map your features to integers ● Leave your computer on at night to build the model from your training data
  • 27. ... become don'ts ● Reduce the number of features by hand guessing which features are relevant ● Use non-linear approaches such as the kernel trick ● Map your features to integers ● Leave your workstation on at night to build the model from your training data
  • 28. Reduce the number of features ● Vowpal Wabbit can handle sparse featuresets having millions of features efficiently
  • 29. Use non-linear approaches ● Sparse dataset with many dimensions yields comparative results to using fewer features with kernel tricks ● One can ask Vowpal Wabbit to generate new features as the Cartesian product of existing features, using namespaces: – That is, given features u^a, u^b, v^c, and v^d, by using command line parameter -q uv, VW can make u^a^v^c and so forth.
  • 30. Map your features to integers ● Vowpal Wabbit hashes feature names to integers internally using Murmur hash v3 ● The downside of hashing are the possible collisions for too many features – H(“Nigerian prince”) = H(“job interview”) ● Though it also decreases the possibility of overfitting
  • 31. Fit the model at night ● Vowpal Wabbit supports online and active learning. ● Most learning tasks are IO-, not CPU-bound ● That is to mean, your feature extraction code will be the bottleneck.
  • 32. Supervised Learning ● Training Label Input FFeeaatuturree e exxtrtraacctotorr Features ● Prediction Machine Learning algorithm Machine Learning algorithm Input FFeeaatuturree e exxtrtraacctotorr Features MMooddeell Label
  • 33. Offline vs Online learning ● In offline learning the model is fed all the input, after which it is finalized; the finalized model will be used for predictions – That is, teach the classifier all kinds of unwanted messages before actual use, and use the resulting classifier for 10 years. → Certainly not going to work. ● In online learning, the model can be used for predictions right after the first input – The model will gradually converge towards better classification
  • 34. Semisupervised learning – active learning ● Asking for input for classifier is expensive – If one asks to label all given examples, it is almost even worse as not asking at all ● The solution is active learning
  • 35. Active learning ● Train only if importance >= threshold Label Input FFeeaatuturree e exxtrtraacctotorr Features Machine Learning algorithm Machine Learning algorithm ● Prediction Input FFeeaatuturree e exxtrtraacctotorr Features MMooddeell Label Importance
  • 36. How to use Vowpal Wabbit ● You can use it on the command line. To teach a model using logistic regression: % cat train.txt -1 |t nigerian prince offers money ... |a user@example.com 1 |t invite job interview ... |a boss@dreamco.com ... % vw -d train.txt --loss_function=logistic -f model.vw ● To test % vw -i model.vw --loss_function=logistic -p /dev/stdout |t nigerian prince interview -0.145824 |t spam ham and eggs |a boss@dreamco.com 0.134225
  • 37. How to use VW in Python ● Multiple libraries exist – Though none of the APIs are to my liking – So I wrote my own from caerbannog import Rabbit