SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
A Gentle Introduction to Machine Learning
#VSSML16
September 2016
#VSSML16 A Gentle Introduction to Machine Learning September 2016 1 / 56
Outline
1 A Machine Learning Fable
2 Machine Learning: Some Intuition
3 School Overview
4 The Basic Idea: Create a Program From Data
5 Modeling
6 Do More With Your Model
7 Evaluation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 2 / 56
Outline
1 A Machine Learning Fable
2 Machine Learning: Some Intuition
3 School Overview
4 The Basic Idea: Create a Program From Data
5 Modeling
6 Do More With Your Model
7 Evaluation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 3 / 56
A Churn Problem
• You’re the CEO of a mobile
phone service
(congratulations!)
• Some percent of your
customers leave every month
(churn)
• You want to reach out to the
ones you think are going to
leave next month (but you
can’t call everyone)
• And who might they be?
#VSSML16 A Gentle Introduction to Machine Learning September 2016 4 / 56
Begin with the End In Mind
• Currently, you use a simple targeting strategy designed by hand,
which identifies the 10,000 customers most likely to churn
• For every five people you call, two are considering leaving (false
positive rate of 60%)
• On these customers, your operators can convince half to stay
• Each customer saved is worth $500
• What if you could reduce that false positive rate to 40%?
#VSSML16 A Gentle Introduction to Machine Learning September 2016 5 / 56
You Have The Data!
Luckily, you’ve been tracking customer outcomes for months, along
with a number of relevant customer attributes.
Minutes Used Last Month Bill Support Calls Website Visits Churn?
104 $103.60 0 0 No
124 $56.33 1 0 No
56 $214.60 2 0 Yes
2410 $305.60 0 5 No
536 $145.70 0 0 No
234 $122.09 0 1 No
201 $185.76 1 7 Yes
111 $83.60 3 2 No
#VSSML16 A Gentle Introduction to Machine Learning September 2016 6 / 56
Now . . . magic!
• Can we use the data to create
a better targeting strategy, with
virtually no other work?
(Spoiler: YES)
• Can we use the data to
evaluate that strategy,
confirming a better false
positive rate? (Spoiler: YES)
• How? (Spoiler: MACHINE
LEARNING)
#VSSML16 A Gentle Introduction to Machine Learning September 2016 7 / 56
Outline
1 A Machine Learning Fable
2 Machine Learning: Some Intuition
3 School Overview
4 The Basic Idea: Create a Program From Data
5 Modeling
6 Do More With Your Model
7 Evaluation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 8 / 56
In a Nutshell
• Collect row-column data about
past data from your prediction
problem (e.g., previous
months of customer data)
• Feed this data to a machine
learning algorithm
• The algorithm creates a
program (alternately,
“predictive model” or
“classifier”) that makes
predictions on future data
#VSSML16 A Gentle Introduction to Machine Learning September 2016 9 / 56
Traditional Expert System: Expert and Programmer
• Machine learning breaks the
traditional paradigm of expert
systems
• Experts know how the
prediction is made
• Programmers know how to
translate the expert’s
knowledge into a computer
program that makes the
prediction
• Constructing a system
requires both (though they
may be the same person)
#VSSML16 A Gentle Introduction to Machine Learning September 2016 10 / 56
Using Machine Learning: Data and Algorithm
• With machine learning, data replaces the expert
Is often more accurate than “expertise”
Article: “Specialist Knowledge is Useless and Unhelpful”1
Requires no human expertise except how to collect the data
The data may already be there
• Algorithms replace programmers
Algorithms are faster than programmers, enabling iteration
Algorithms are more modular than programmers
Data offers the opportunity for performance measurement (which
you would be doing in any case, right?)
1
https://www.newscientist.com/article/
mg21628930-400-specialist-knowledge-is-useless-and-unhelpful/
#VSSML16 A Gentle Introduction to Machine Learning September 2016 11 / 56
Outline
1 A Machine Learning Fable
2 Machine Learning: Some Intuition
3 School Overview
4 The Basic Idea: Create a Program From Data
5 Modeling
6 Do More With Your Model
7 Evaluation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 12 / 56
Today
• Morning
Introduction, Models, and Evaluations
Ensembles and Logistic Regressions
• Afternoon
Clusters and Anomaly Detection
Association Discovery and Latent Dirichlet Allocation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 13 / 56
Tomorrow
• Morning
Basic Transformations
Feature Engineering
• Afternoon
REST API, Bindings, and Basic Workflows
Advanced Workflows: Algorithms as Workflows
#VSSML16 A Gentle Introduction to Machine Learning September 2016 14 / 56
Outline
1 A Machine Learning Fable
2 Machine Learning: Some Intuition
3 School Overview
4 The Basic Idea: Create a Program From Data
5 Modeling
6 Do More With Your Model
7 Evaluation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 15 / 56
First: The Data
In the simplest and most numerous cases, machine learning begins
with row-column data.
Minutes Used Last Month Bill Support Calls Website Visits Churn?
104 $103.60 0 0 No
124 $56.33 1 0 No
56 $214.60 2 0 Yes
2410 $305.60 0 5 No
536 $145.70 0 0 No
234 $122.09 0 1 No
201 $185.76 1 7 Yes
111 $83.60 3 2 No
#VSSML16 A Gentle Introduction to Machine Learning September 2016 16 / 56
Rows: What is the Prediction About?
• Each row (or instance) in the
data represents the thing
about which you are making a
prediction
• Churn prediction: Each row is
a customer
• Medical diagnosis: Each row
is a patient
• Credit card fraud detection:
Each row is a transaction
• Market closing price forecast:
Each row is a day
#VSSML16 A Gentle Introduction to Machine Learning September 2016 17 / 56
Columns: What information Will Help Us Predict?
• Each column (or field, or feature) represents a piece of
information about the thing in each row
Churn prediction: minutes used, calls to support
Medical diagnosis: BMI, temperature, test results
Credit card fraud detection: Amount, transaction type, Geographical
information (maybe difference from previous transactions)
Market closing price forecast: Opening price, previous day’s
open/close, five day trend
• How much and what type of information should you collect?
There’s no general answer here; it’s “domain-specific”
Question one: How much does it matter (as a function of model
accuracy)?
Question two: How much does it cost to collect?
#VSSML16 A Gentle Introduction to Machine Learning September 2016 18 / 56
Objective: What are we Trying to Predict?
• One of the columns is special:
The “objective” is the column
in the data that contains the
information we want to predict
• Churn prediction: Customer
did or did not churn
• Medical diagnosis: Positive or
negative for some disease
• Credit card fraud detection:
Transaction is or is not
fraudulent
• Market closing price forecast:
The closing price on the given
day
#VSSML16 A Gentle Introduction to Machine Learning September 2016 19 / 56
The Goal: Creating a Prediction Machine
• Feed this data to a machine learning algorithm
• The algorithm constructs a program (or model or classifier):
Inputs: A single row of data, excluding the objective
Outputs: A prediction of the objective for that row
• Most importantly, the input row need not come from the training
data
#VSSML16 A Gentle Introduction to Machine Learning September 2016 20 / 56
When is this a Good Idea?
• Remember: Machine learning
replaces expert and
programmer with data and
algorithm
• Is it hard to find an expert?
• Can the programmer encode
the knowledge (quickly
enough, accurately enough)?
#VSSML16 A Gentle Introduction to Machine Learning September 2016 21 / 56
People Can’t Tell You How They Do It
• Optical character recognition
(label a written character given
its image)
• Object detection (image does
or does not contain an object)
• Speech recognition (label a
sentence given spoken sound
file)
#VSSML16 A Gentle Introduction to Machine Learning September 2016 22 / 56
Human Experts are Rare or Expensive
• Medical diagnosis, MRI
reading, etc. (predict
bio-abnormalities from tests)
• Autonomous helicopter
operation
• Game playing (at extremely
high levels)
#VSSML16 A Gentle Introduction to Machine Learning September 2016 23 / 56
Everyone Needs Their Own Algorithm
• Spam detection (predict
spam/not spam from e-mail
text)
• Activity recognition (predict
user activity from mobile
sensors)
• Location prediction (predict
future user location given
current state)
• Anything that’s “personalized”,
and generates enough data
(mobiles!)
• Aside: IoT has the potential to
be huge for machine learning
#VSSML16 A Gentle Introduction to Machine Learning September 2016 24 / 56
Every Little Bit Counts
• Market activity modeling
(buy/sell at a given time)
• Recognition tasks that are
“easy” (handwriting detection)
• Churn prediction?
• Any time there’s a
performance critical hand-built
system
#VSSML16 A Gentle Introduction to Machine Learning September 2016 25 / 56
When is this a Bad idea?
• Human experts are relatively cheap and easy to come by
Natural language processing for stock traders
Automatic defect detection in printer operation
• A program is easily written by hand
Some simple if-then rules often perform well
The best program is the one that’s already there
• The data is difficult or expensive to acquire
Medical domains
Automatic processing of images
#VSSML16 A Gentle Introduction to Machine Learning September 2016 26 / 56
Outline
1 A Machine Learning Fable
2 Machine Learning: Some Intuition
3 School Overview
4 The Basic Idea: Create a Program From Data
5 Modeling
6 Do More With Your Model
7 Evaluation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 27 / 56
Searching in Hypothesis Space
• Machine learning algorithms don’t exactly create a program
• More accurately, they search for a program consistent with the
training data
Search must be very clever
Usually there is some sort of “Occam’s razor” involved
• The space of possible solutions in which the algorithm search is
called its hypothesis space
• The algorithm is trying to do “reverse science”!
#VSSML16 A Gentle Introduction to Machine Learning September 2016 28 / 56
Some Hypothesis Spaces
• Logistic regression: Sets of all
possible feature coefficients
and a bias term
• Neural network: Weights for all
nodes in the network
• Support vector machines:
Coefficients on each training
point
• Note: Parametric vs.
Non-parametric
#VSSML16 A Gentle Introduction to Machine Learning September 2016 29 / 56
A Simple Hypothesis Space
Consider thresholds on a single variable, and predict “majority class” of
the resulting subsets
#VSSML16 A Gentle Introduction to Machine Learning September 2016 30 / 56
A Simple Hypothesis Space
Visits to Website > 0
#VSSML16 A Gentle Introduction to Machine Learning September 2016 31 / 56
A Simple Hypothesis Space
Minutes > 200
#VSSML16 A Gentle Introduction to Machine Learning September 2016 32 / 56
A Simple Hypothesis Space
Last Bill > $180
#VSSML16 A Gentle Introduction to Machine Learning September 2016 33 / 56
Good Question
• Subset purity
• Large difference between the
prior and posterior objective
distributions
• How to find the best question?
Try them all!
#VSSML16 A Gentle Introduction to Machine Learning September 2016 34 / 56
Expanding the Space
There’s no reason to stop at just one question:
Last Bill > $180
#VSSML16 A Gentle Introduction to Machine Learning September 2016 35 / 56
Expanding the Space
There’s no reason to stop at just one question:
Last Bill > $180 AND Support Calls > 0
#VSSML16 A Gentle Introduction to Machine Learning September 2016 36 / 56
The Decision Tree
• Why stop at two?
• Suggests a recursive
algorithm:
Choose a threshold
Partition the data into
subsets
Choose a threshold for the
subsets, and so on
• This is a decision tree
#VSSML16 A Gentle Introduction to Machine Learning September 2016 37 / 56
Visualizing a Decision Tree
• Each node in the tree
represents a threshold; a
question asked of the data
• Branches leading from the
node indicate the two or more
paths data could take
• Thickness of the branches
indicates the amount of
training data that took that
path
• At the leaf or terminal node,
we decide on a prediction;
usually the majority class for
the subset at that leaf.
#VSSML16 A Gentle Introduction to Machine Learning September 2016 38 / 56
When to Stop?
• How do we know when to stop splitting the data?
• Several possible criteria:
When the subset is totally pure (Note: Subsets of size 1 are trivially
pure)
When the size reaches a predetermined minimum
When the number of nodes or tree depth is too large
When you can’t get any statistically significant improvement
• Nodes that don’t meet the latter criteria can be removed after tree
construction via pruning
#VSSML16 A Gentle Introduction to Machine Learning September 2016 39 / 56
Predicting Using a Decision Tree
• The process of building the tree from the training data is called
learning, induction, or training.
• The payoff of using the tree for prediction is inference, prediction,
or scoring.
• To do prediction with a tree, given an instance:
Start at the root node, subjecting the instance to the threshold
“Send” the instance down the appropriate path, to the next
threshold
Continue until you reach a terminal node, then make a prediction
#VSSML16 A Gentle Introduction to Machine Learning September 2016 40 / 56
Outline
1 A Machine Learning Fable
2 Machine Learning: Some Intuition
3 School Overview
4 The Basic Idea: Create a Program From Data
5 Modeling
6 Do More With Your Model
7 Evaluation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 41 / 56
Prediction Confidence - Intuition
• Each terminal node return a prediction . . .
• . . . but are some terminal nodes “better” than others?
• Given a terminal node, how “confident” are we (perhaps for
ranking)?
• Depends on two things:
The number of instances that reach that terminal node
The purity of that subset
• Think of each terminal node as a “mixture of experts”
#VSSML16 A Gentle Introduction to Machine Learning September 2016 42 / 56
Prediction Confidence - Calculation
• Compute a 95% confidence
bound about the probability
implied by the terminal node
subset
• The Wilson score interval:
ˆp + 1
2n z2 ± z ˆp(1−ˆp)
n + z2
4n2
1 + 1
nz2
• Use the lower bound as the
confidence
• Similarish for regression
models
#VSSML16 A Gentle Introduction to Machine Learning September 2016 43 / 56
Field Importance - Intuition
• Which fields drive the model predictions the most?
• Why might we want to know?
Improve data collection practices
Reduce the number of features in your model
Model validation (Watch out for data leakage: objective in the
training data)
• Depends on two things:
Number of times the node uses that feature for the threshold
How much it “matters” when it’s used
#VSSML16 A Gentle Introduction to Machine Learning September 2016 44 / 56
Field Importance - Calculation
• For each node in the tree:
Compute the error of the
prediction in the subset at
that node (before)
Compute the error of the two
child subsets (after)
Compute the improvement
(the difference between the
two)
• Sum up the improvements for
all nodes corresponding to a
given feature
#VSSML16 A Gentle Introduction to Machine Learning September 2016 45 / 56
Outline
1 A Machine Learning Fable
2 Machine Learning: Some Intuition
3 School Overview
4 The Basic Idea: Create a Program From Data
5 Modeling
6 Do More With Your Model
7 Evaluation
#VSSML16 A Gentle Introduction to Machine Learning September 2016 46 / 56
Evaluating Your Model
• You want to know if your
model is good before putting it
in production
• In your data, you know the
right answer!
• So use the data to test how
often your model is right
#VSSML16 A Gentle Introduction to Machine Learning September 2016 47 / 56
Don’t Evaluate on the Training Data!
• Never train and test on the same data
• Many non-parametric models are able to memorize the training
data
• This results in evaluations that are sometimes wildly optimistic
(which is the worst)
• Solution: Split your data into training and testing subsets (80%
and 20% is customary)
#VSSML16 A Gentle Introduction to Machine Learning September 2016 48 / 56
Watch out For Luck!
• Even splitting your data is
sometimes not enough
• You may draw an “easy”
subset (especially possible
with small data)
• Can be disastrous if the “edge”
you’re expecting is small
• Solution: Do multiple runs and
average (or cross-validate)
#VSSML16 A Gentle Introduction to Machine Learning September 2016 49 / 56
Accuracy Can Be Misleading
• The top-line evaluation number is accuracy; the number of correct
predictions divided by the number of total predictions
• Accuracy can be misleading!
Suppose only 5% of my customers churn every month
Suppose I just predict “no churn” for everybody
Ta-da! 95% accuracy!
But I get the same 95% accuracy if predict all “churn” instances
correct with a 50% false positive rate!
• Lesson: Accuracy is broken when classes are unbalanced
#VSSML16 A Gentle Introduction to Machine Learning September 2016 50 / 56
The Confusion Matrix
• What to do if accuracy isn’t what you want?
• Look at the specific types of mistakes the algorithm makes
• This is the confusion matrix
#VSSML16 A Gentle Introduction to Machine Learning September 2016 51 / 56
Aside: What If You Don’t Like it?
• You see your confusion matrix and it’s making “the wrong
mistakes” (maybe you can even confirm by looking at the model)
• Often this is caused by unbalanced data; data where one class
dominates the dataset
• You suspect that a trade-off could be made
• Using weights is a good way to do this
• A good place to start is often balancing the objective
#VSSML16 A Gentle Introduction to Machine Learning September 2016 52 / 56
But What if You Want Just One Number?
• For model selection, you usually want a single number for a direct
comparison
• There are other functions of the confusion matrix besides
accuracy
• BigML provides a few of these:
Φ-coefficient (common in soft sciences)
F1-score (information retrieval, where there’s a rare positive class)
Balanced Accuracy (accuracy, averaged class-wise by inverse
frequency)
#VSSML16 A Gentle Introduction to Machine Learning September 2016 53 / 56
The Right Thing is Always The Right Thing
• None of these things are better in general than any other
• In your domain, it might be best to come up with your own function
• A common form is the cost matrix: How much does a mistake of
each type cost:
Total cost = cFPnFP + cFNnFN
where cx is the cost of a mistake of type x (false positive or false
negative), and nx is the number of mistakes of that type.
• This is an important part of what you, the domain expert, bring to
the table! Don’t ignore it!
#VSSML16 A Gentle Introduction to Machine Learning September 2016 54 / 56
Regression Evaluation: Generally Less Fraught
• To evaluate regression models, we first measure how much error
we would have if we just predicted the mean objective for the
whole dataset
• This functions as a baseline
• How much (as a fraction) of the baseline error does the model
eliminate?
1.0 is best
0.0 is not good at all
And of course, we can go negative
• This is R2
• What is “good?” Again, this is domain-specific, but at least
improvement with R2 is usually fairly monotonic
#VSSML16 A Gentle Introduction to Machine Learning September 2016 55 / 56
Fin!
Questions?
#VSSML16 A Gentle Introduction to Machine Learning September 2016 56 / 56

Weitere ähnliche Inhalte

Andere mochten auch

VSSML16 L5. Basic Data Transformations
VSSML16 L5. Basic Data TransformationsVSSML16 L5. Basic Data Transformations
VSSML16 L5. Basic Data TransformationsBigML, Inc
 
VSSML16 LR1. Summary Day 1
VSSML16 LR1. Summary Day 1VSSML16 LR1. Summary Day 1
VSSML16 LR1. Summary Day 1BigML, Inc
 
BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...BigML, Inc
 
VSSML16 L6. Feature Engineering
VSSML16 L6. Feature EngineeringVSSML16 L6. Feature Engineering
VSSML16 L6. Feature EngineeringBigML, Inc
 
BSSML16 L8. REST API, Bindings, and Basic Workflows
BSSML16 L8. REST API, Bindings, and Basic WorkflowsBSSML16 L8. REST API, Bindings, and Basic Workflows
BSSML16 L8. REST API, Bindings, and Basic WorkflowsBigML, Inc
 
BSSML16 L4. Association Discovery and Topic Modeling
BSSML16 L4. Association Discovery and Topic ModelingBSSML16 L4. Association Discovery and Topic Modeling
BSSML16 L4. Association Discovery and Topic ModelingBigML, Inc
 
BSSML16 L6. Basic Data Transformations
BSSML16 L6. Basic Data TransformationsBSSML16 L6. Basic Data Transformations
BSSML16 L6. Basic Data TransformationsBigML, Inc
 
Machine Learning for Understanding and Managing Ecosystems
Machine Learning for Understanding and Managing EcosystemsMachine Learning for Understanding and Managing Ecosystems
Machine Learning for Understanding and Managing Ecosystemsdiannepatricia
 
7 lessons to learn of Brazil defeat, to your company
7 lessons to learn of Brazil defeat, to your company 7 lessons to learn of Brazil defeat, to your company
7 lessons to learn of Brazil defeat, to your company Alexandre Uehara
 
BSSML16 L1. Introduction, Models, and Evaluations
BSSML16 L1. Introduction, Models, and EvaluationsBSSML16 L1. Introduction, Models, and Evaluations
BSSML16 L1. Introduction, Models, and EvaluationsBigML, Inc
 
Data science for advanced dummies
Data science for advanced dummiesData science for advanced dummies
Data science for advanced dummiesSaurav Chakravorty
 
Quero trabalhar com big data data science, como faço-
Quero trabalhar com big data   data science, como faço-Quero trabalhar com big data   data science, como faço-
Quero trabalhar com big data data science, como faço-Alexandre Uehara
 
Demystifying Machine Learning - How to give your business superpowers.
Demystifying Machine Learning - How to give your business superpowers.Demystifying Machine Learning - How to give your business superpowers.
Demystifying Machine Learning - How to give your business superpowers.10x Nation
 
Data Science & Big Data, made in Switzerland
Data Science & Big Data, made in SwitzerlandData Science & Big Data, made in Switzerland
Data Science & Big Data, made in SwitzerlandThilo Stadelmann
 
API, WhizzML and Apps
API, WhizzML and AppsAPI, WhizzML and Apps
API, WhizzML and AppsBigML, Inc
 

Andere mochten auch (20)

Begin with the End in Mind
Begin with the End in MindBegin with the End in Mind
Begin with the End in Mind
 
VSSML16 L5. Basic Data Transformations
VSSML16 L5. Basic Data TransformationsVSSML16 L5. Basic Data Transformations
VSSML16 L5. Basic Data Transformations
 
VSSML16 LR1. Summary Day 1
VSSML16 LR1. Summary Day 1VSSML16 LR1. Summary Day 1
VSSML16 LR1. Summary Day 1
 
BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
 
VSSML16 L6. Feature Engineering
VSSML16 L6. Feature EngineeringVSSML16 L6. Feature Engineering
VSSML16 L6. Feature Engineering
 
BSSML16 L8. REST API, Bindings, and Basic Workflows
BSSML16 L8. REST API, Bindings, and Basic WorkflowsBSSML16 L8. REST API, Bindings, and Basic Workflows
BSSML16 L8. REST API, Bindings, and Basic Workflows
 
BSSML16 L4. Association Discovery and Topic Modeling
BSSML16 L4. Association Discovery and Topic ModelingBSSML16 L4. Association Discovery and Topic Modeling
BSSML16 L4. Association Discovery and Topic Modeling
 
BSSML16 L6. Basic Data Transformations
BSSML16 L6. Basic Data TransformationsBSSML16 L6. Basic Data Transformations
BSSML16 L6. Basic Data Transformations
 
#48 Machine learning
#48 Machine learning#48 Machine learning
#48 Machine learning
 
Machine Learning for Understanding and Managing Ecosystems
Machine Learning for Understanding and Managing EcosystemsMachine Learning for Understanding and Managing Ecosystems
Machine Learning for Understanding and Managing Ecosystems
 
Data Science For Dummies From a Dummy
Data Science For Dummies From a DummyData Science For Dummies From a Dummy
Data Science For Dummies From a Dummy
 
7 lessons to learn of Brazil defeat, to your company
7 lessons to learn of Brazil defeat, to your company 7 lessons to learn of Brazil defeat, to your company
7 lessons to learn of Brazil defeat, to your company
 
BSSML16 L1. Introduction, Models, and Evaluations
BSSML16 L1. Introduction, Models, and EvaluationsBSSML16 L1. Introduction, Models, and Evaluations
BSSML16 L1. Introduction, Models, and Evaluations
 
ES6 metaprogramming unleashed
ES6 metaprogramming unleashedES6 metaprogramming unleashed
ES6 metaprogramming unleashed
 
Data science for advanced dummies
Data science for advanced dummiesData science for advanced dummies
Data science for advanced dummies
 
Quero trabalhar com big data data science, como faço-
Quero trabalhar com big data   data science, como faço-Quero trabalhar com big data   data science, como faço-
Quero trabalhar com big data data science, como faço-
 
Demystifying Machine Learning - How to give your business superpowers.
Demystifying Machine Learning - How to give your business superpowers.Demystifying Machine Learning - How to give your business superpowers.
Demystifying Machine Learning - How to give your business superpowers.
 
Data Science & Big Data, made in Switzerland
Data Science & Big Data, made in SwitzerlandData Science & Big Data, made in Switzerland
Data Science & Big Data, made in Switzerland
 
Actividad 02
Actividad 02Actividad 02
Actividad 02
 
API, WhizzML and Apps
API, WhizzML and AppsAPI, WhizzML and Apps
API, WhizzML and Apps
 

Mehr von BigML, Inc

Digital Transformation and Process Optimization in Manufacturing
Digital Transformation and Process Optimization in ManufacturingDigital Transformation and Process Optimization in Manufacturing
Digital Transformation and Process Optimization in ManufacturingBigML, Inc
 
DutchMLSchool 2022 - Automation
DutchMLSchool 2022 - AutomationDutchMLSchool 2022 - Automation
DutchMLSchool 2022 - AutomationBigML, Inc
 
DutchMLSchool 2022 - ML for AML Compliance
DutchMLSchool 2022 - ML for AML ComplianceDutchMLSchool 2022 - ML for AML Compliance
DutchMLSchool 2022 - ML for AML ComplianceBigML, Inc
 
DutchMLSchool 2022 - Multi Perspective Anomalies
DutchMLSchool 2022 - Multi Perspective AnomaliesDutchMLSchool 2022 - Multi Perspective Anomalies
DutchMLSchool 2022 - Multi Perspective AnomaliesBigML, Inc
 
DutchMLSchool 2022 - My First Anomaly Detector
DutchMLSchool 2022 - My First Anomaly Detector DutchMLSchool 2022 - My First Anomaly Detector
DutchMLSchool 2022 - My First Anomaly Detector BigML, Inc
 
DutchMLSchool 2022 - Anomaly Detection
DutchMLSchool 2022 - Anomaly DetectionDutchMLSchool 2022 - Anomaly Detection
DutchMLSchool 2022 - Anomaly DetectionBigML, Inc
 
DutchMLSchool 2022 - History and Developments in ML
DutchMLSchool 2022 - History and Developments in MLDutchMLSchool 2022 - History and Developments in ML
DutchMLSchool 2022 - History and Developments in MLBigML, Inc
 
DutchMLSchool 2022 - End-to-End ML
DutchMLSchool 2022 - End-to-End MLDutchMLSchool 2022 - End-to-End ML
DutchMLSchool 2022 - End-to-End MLBigML, Inc
 
DutchMLSchool 2022 - A Data-Driven Company
DutchMLSchool 2022 - A Data-Driven CompanyDutchMLSchool 2022 - A Data-Driven Company
DutchMLSchool 2022 - A Data-Driven CompanyBigML, Inc
 
DutchMLSchool 2022 - ML in the Legal Sector
DutchMLSchool 2022 - ML in the Legal SectorDutchMLSchool 2022 - ML in the Legal Sector
DutchMLSchool 2022 - ML in the Legal SectorBigML, Inc
 
DutchMLSchool 2022 - Smart Safe Stadiums
DutchMLSchool 2022 - Smart Safe StadiumsDutchMLSchool 2022 - Smart Safe Stadiums
DutchMLSchool 2022 - Smart Safe StadiumsBigML, Inc
 
DutchMLSchool 2022 - Process Optimization in Manufacturing Plants
DutchMLSchool 2022 - Process Optimization in Manufacturing PlantsDutchMLSchool 2022 - Process Optimization in Manufacturing Plants
DutchMLSchool 2022 - Process Optimization in Manufacturing PlantsBigML, Inc
 
DutchMLSchool 2022 - Anomaly Detection at Scale
DutchMLSchool 2022 - Anomaly Detection at ScaleDutchMLSchool 2022 - Anomaly Detection at Scale
DutchMLSchool 2022 - Anomaly Detection at ScaleBigML, Inc
 
DutchMLSchool 2022 - Citizen Development in AI
DutchMLSchool 2022 - Citizen Development in AIDutchMLSchool 2022 - Citizen Development in AI
DutchMLSchool 2022 - Citizen Development in AIBigML, Inc
 
Democratizing Object Detection
Democratizing Object DetectionDemocratizing Object Detection
Democratizing Object DetectionBigML, Inc
 
BigML Release: Image Processing
BigML Release: Image ProcessingBigML Release: Image Processing
BigML Release: Image ProcessingBigML, Inc
 
Machine Learning in Retail: Know Your Customers' Customer. See Your Future
Machine Learning in Retail: Know Your Customers' Customer. See Your FutureMachine Learning in Retail: Know Your Customers' Customer. See Your Future
Machine Learning in Retail: Know Your Customers' Customer. See Your FutureBigML, Inc
 
Machine Learning in Retail: ML in the Retail Sector
Machine Learning in Retail: ML in the Retail SectorMachine Learning in Retail: ML in the Retail Sector
Machine Learning in Retail: ML in the Retail SectorBigML, Inc
 
ML in GRC: Machine Learning in Legal Automation, How to Trust a Lawyerbot
ML in GRC: Machine Learning in Legal Automation, How to Trust a LawyerbotML in GRC: Machine Learning in Legal Automation, How to Trust a Lawyerbot
ML in GRC: Machine Learning in Legal Automation, How to Trust a LawyerbotBigML, Inc
 
ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...
ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...
ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...BigML, Inc
 

Mehr von BigML, Inc (20)

Digital Transformation and Process Optimization in Manufacturing
Digital Transformation and Process Optimization in ManufacturingDigital Transformation and Process Optimization in Manufacturing
Digital Transformation and Process Optimization in Manufacturing
 
DutchMLSchool 2022 - Automation
DutchMLSchool 2022 - AutomationDutchMLSchool 2022 - Automation
DutchMLSchool 2022 - Automation
 
DutchMLSchool 2022 - ML for AML Compliance
DutchMLSchool 2022 - ML for AML ComplianceDutchMLSchool 2022 - ML for AML Compliance
DutchMLSchool 2022 - ML for AML Compliance
 
DutchMLSchool 2022 - Multi Perspective Anomalies
DutchMLSchool 2022 - Multi Perspective AnomaliesDutchMLSchool 2022 - Multi Perspective Anomalies
DutchMLSchool 2022 - Multi Perspective Anomalies
 
DutchMLSchool 2022 - My First Anomaly Detector
DutchMLSchool 2022 - My First Anomaly Detector DutchMLSchool 2022 - My First Anomaly Detector
DutchMLSchool 2022 - My First Anomaly Detector
 
DutchMLSchool 2022 - Anomaly Detection
DutchMLSchool 2022 - Anomaly DetectionDutchMLSchool 2022 - Anomaly Detection
DutchMLSchool 2022 - Anomaly Detection
 
DutchMLSchool 2022 - History and Developments in ML
DutchMLSchool 2022 - History and Developments in MLDutchMLSchool 2022 - History and Developments in ML
DutchMLSchool 2022 - History and Developments in ML
 
DutchMLSchool 2022 - End-to-End ML
DutchMLSchool 2022 - End-to-End MLDutchMLSchool 2022 - End-to-End ML
DutchMLSchool 2022 - End-to-End ML
 
DutchMLSchool 2022 - A Data-Driven Company
DutchMLSchool 2022 - A Data-Driven CompanyDutchMLSchool 2022 - A Data-Driven Company
DutchMLSchool 2022 - A Data-Driven Company
 
DutchMLSchool 2022 - ML in the Legal Sector
DutchMLSchool 2022 - ML in the Legal SectorDutchMLSchool 2022 - ML in the Legal Sector
DutchMLSchool 2022 - ML in the Legal Sector
 
DutchMLSchool 2022 - Smart Safe Stadiums
DutchMLSchool 2022 - Smart Safe StadiumsDutchMLSchool 2022 - Smart Safe Stadiums
DutchMLSchool 2022 - Smart Safe Stadiums
 
DutchMLSchool 2022 - Process Optimization in Manufacturing Plants
DutchMLSchool 2022 - Process Optimization in Manufacturing PlantsDutchMLSchool 2022 - Process Optimization in Manufacturing Plants
DutchMLSchool 2022 - Process Optimization in Manufacturing Plants
 
DutchMLSchool 2022 - Anomaly Detection at Scale
DutchMLSchool 2022 - Anomaly Detection at ScaleDutchMLSchool 2022 - Anomaly Detection at Scale
DutchMLSchool 2022 - Anomaly Detection at Scale
 
DutchMLSchool 2022 - Citizen Development in AI
DutchMLSchool 2022 - Citizen Development in AIDutchMLSchool 2022 - Citizen Development in AI
DutchMLSchool 2022 - Citizen Development in AI
 
Democratizing Object Detection
Democratizing Object DetectionDemocratizing Object Detection
Democratizing Object Detection
 
BigML Release: Image Processing
BigML Release: Image ProcessingBigML Release: Image Processing
BigML Release: Image Processing
 
Machine Learning in Retail: Know Your Customers' Customer. See Your Future
Machine Learning in Retail: Know Your Customers' Customer. See Your FutureMachine Learning in Retail: Know Your Customers' Customer. See Your Future
Machine Learning in Retail: Know Your Customers' Customer. See Your Future
 
Machine Learning in Retail: ML in the Retail Sector
Machine Learning in Retail: ML in the Retail SectorMachine Learning in Retail: ML in the Retail Sector
Machine Learning in Retail: ML in the Retail Sector
 
ML in GRC: Machine Learning in Legal Automation, How to Trust a Lawyerbot
ML in GRC: Machine Learning in Legal Automation, How to Trust a LawyerbotML in GRC: Machine Learning in Legal Automation, How to Trust a Lawyerbot
ML in GRC: Machine Learning in Legal Automation, How to Trust a Lawyerbot
 
ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...
ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...
ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...
 

Kürzlich hochgeladen

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
 
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
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...amitlee9823
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
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
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...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
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
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
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 

Kürzlich hochgeladen (20)

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
 
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
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
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
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
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
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
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...
 
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
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 

VSSML16 L1. Introduction, Models, and Evaluations

  • 1. A Gentle Introduction to Machine Learning #VSSML16 September 2016 #VSSML16 A Gentle Introduction to Machine Learning September 2016 1 / 56
  • 2. Outline 1 A Machine Learning Fable 2 Machine Learning: Some Intuition 3 School Overview 4 The Basic Idea: Create a Program From Data 5 Modeling 6 Do More With Your Model 7 Evaluation #VSSML16 A Gentle Introduction to Machine Learning September 2016 2 / 56
  • 3. Outline 1 A Machine Learning Fable 2 Machine Learning: Some Intuition 3 School Overview 4 The Basic Idea: Create a Program From Data 5 Modeling 6 Do More With Your Model 7 Evaluation #VSSML16 A Gentle Introduction to Machine Learning September 2016 3 / 56
  • 4. A Churn Problem • You’re the CEO of a mobile phone service (congratulations!) • Some percent of your customers leave every month (churn) • You want to reach out to the ones you think are going to leave next month (but you can’t call everyone) • And who might they be? #VSSML16 A Gentle Introduction to Machine Learning September 2016 4 / 56
  • 5. Begin with the End In Mind • Currently, you use a simple targeting strategy designed by hand, which identifies the 10,000 customers most likely to churn • For every five people you call, two are considering leaving (false positive rate of 60%) • On these customers, your operators can convince half to stay • Each customer saved is worth $500 • What if you could reduce that false positive rate to 40%? #VSSML16 A Gentle Introduction to Machine Learning September 2016 5 / 56
  • 6. You Have The Data! Luckily, you’ve been tracking customer outcomes for months, along with a number of relevant customer attributes. Minutes Used Last Month Bill Support Calls Website Visits Churn? 104 $103.60 0 0 No 124 $56.33 1 0 No 56 $214.60 2 0 Yes 2410 $305.60 0 5 No 536 $145.70 0 0 No 234 $122.09 0 1 No 201 $185.76 1 7 Yes 111 $83.60 3 2 No #VSSML16 A Gentle Introduction to Machine Learning September 2016 6 / 56
  • 7. Now . . . magic! • Can we use the data to create a better targeting strategy, with virtually no other work? (Spoiler: YES) • Can we use the data to evaluate that strategy, confirming a better false positive rate? (Spoiler: YES) • How? (Spoiler: MACHINE LEARNING) #VSSML16 A Gentle Introduction to Machine Learning September 2016 7 / 56
  • 8. Outline 1 A Machine Learning Fable 2 Machine Learning: Some Intuition 3 School Overview 4 The Basic Idea: Create a Program From Data 5 Modeling 6 Do More With Your Model 7 Evaluation #VSSML16 A Gentle Introduction to Machine Learning September 2016 8 / 56
  • 9. In a Nutshell • Collect row-column data about past data from your prediction problem (e.g., previous months of customer data) • Feed this data to a machine learning algorithm • The algorithm creates a program (alternately, “predictive model” or “classifier”) that makes predictions on future data #VSSML16 A Gentle Introduction to Machine Learning September 2016 9 / 56
  • 10. Traditional Expert System: Expert and Programmer • Machine learning breaks the traditional paradigm of expert systems • Experts know how the prediction is made • Programmers know how to translate the expert’s knowledge into a computer program that makes the prediction • Constructing a system requires both (though they may be the same person) #VSSML16 A Gentle Introduction to Machine Learning September 2016 10 / 56
  • 11. Using Machine Learning: Data and Algorithm • With machine learning, data replaces the expert Is often more accurate than “expertise” Article: “Specialist Knowledge is Useless and Unhelpful”1 Requires no human expertise except how to collect the data The data may already be there • Algorithms replace programmers Algorithms are faster than programmers, enabling iteration Algorithms are more modular than programmers Data offers the opportunity for performance measurement (which you would be doing in any case, right?) 1 https://www.newscientist.com/article/ mg21628930-400-specialist-knowledge-is-useless-and-unhelpful/ #VSSML16 A Gentle Introduction to Machine Learning September 2016 11 / 56
  • 12. Outline 1 A Machine Learning Fable 2 Machine Learning: Some Intuition 3 School Overview 4 The Basic Idea: Create a Program From Data 5 Modeling 6 Do More With Your Model 7 Evaluation #VSSML16 A Gentle Introduction to Machine Learning September 2016 12 / 56
  • 13. Today • Morning Introduction, Models, and Evaluations Ensembles and Logistic Regressions • Afternoon Clusters and Anomaly Detection Association Discovery and Latent Dirichlet Allocation #VSSML16 A Gentle Introduction to Machine Learning September 2016 13 / 56
  • 14. Tomorrow • Morning Basic Transformations Feature Engineering • Afternoon REST API, Bindings, and Basic Workflows Advanced Workflows: Algorithms as Workflows #VSSML16 A Gentle Introduction to Machine Learning September 2016 14 / 56
  • 15. Outline 1 A Machine Learning Fable 2 Machine Learning: Some Intuition 3 School Overview 4 The Basic Idea: Create a Program From Data 5 Modeling 6 Do More With Your Model 7 Evaluation #VSSML16 A Gentle Introduction to Machine Learning September 2016 15 / 56
  • 16. First: The Data In the simplest and most numerous cases, machine learning begins with row-column data. Minutes Used Last Month Bill Support Calls Website Visits Churn? 104 $103.60 0 0 No 124 $56.33 1 0 No 56 $214.60 2 0 Yes 2410 $305.60 0 5 No 536 $145.70 0 0 No 234 $122.09 0 1 No 201 $185.76 1 7 Yes 111 $83.60 3 2 No #VSSML16 A Gentle Introduction to Machine Learning September 2016 16 / 56
  • 17. Rows: What is the Prediction About? • Each row (or instance) in the data represents the thing about which you are making a prediction • Churn prediction: Each row is a customer • Medical diagnosis: Each row is a patient • Credit card fraud detection: Each row is a transaction • Market closing price forecast: Each row is a day #VSSML16 A Gentle Introduction to Machine Learning September 2016 17 / 56
  • 18. Columns: What information Will Help Us Predict? • Each column (or field, or feature) represents a piece of information about the thing in each row Churn prediction: minutes used, calls to support Medical diagnosis: BMI, temperature, test results Credit card fraud detection: Amount, transaction type, Geographical information (maybe difference from previous transactions) Market closing price forecast: Opening price, previous day’s open/close, five day trend • How much and what type of information should you collect? There’s no general answer here; it’s “domain-specific” Question one: How much does it matter (as a function of model accuracy)? Question two: How much does it cost to collect? #VSSML16 A Gentle Introduction to Machine Learning September 2016 18 / 56
  • 19. Objective: What are we Trying to Predict? • One of the columns is special: The “objective” is the column in the data that contains the information we want to predict • Churn prediction: Customer did or did not churn • Medical diagnosis: Positive or negative for some disease • Credit card fraud detection: Transaction is or is not fraudulent • Market closing price forecast: The closing price on the given day #VSSML16 A Gentle Introduction to Machine Learning September 2016 19 / 56
  • 20. The Goal: Creating a Prediction Machine • Feed this data to a machine learning algorithm • The algorithm constructs a program (or model or classifier): Inputs: A single row of data, excluding the objective Outputs: A prediction of the objective for that row • Most importantly, the input row need not come from the training data #VSSML16 A Gentle Introduction to Machine Learning September 2016 20 / 56
  • 21. When is this a Good Idea? • Remember: Machine learning replaces expert and programmer with data and algorithm • Is it hard to find an expert? • Can the programmer encode the knowledge (quickly enough, accurately enough)? #VSSML16 A Gentle Introduction to Machine Learning September 2016 21 / 56
  • 22. People Can’t Tell You How They Do It • Optical character recognition (label a written character given its image) • Object detection (image does or does not contain an object) • Speech recognition (label a sentence given spoken sound file) #VSSML16 A Gentle Introduction to Machine Learning September 2016 22 / 56
  • 23. Human Experts are Rare or Expensive • Medical diagnosis, MRI reading, etc. (predict bio-abnormalities from tests) • Autonomous helicopter operation • Game playing (at extremely high levels) #VSSML16 A Gentle Introduction to Machine Learning September 2016 23 / 56
  • 24. Everyone Needs Their Own Algorithm • Spam detection (predict spam/not spam from e-mail text) • Activity recognition (predict user activity from mobile sensors) • Location prediction (predict future user location given current state) • Anything that’s “personalized”, and generates enough data (mobiles!) • Aside: IoT has the potential to be huge for machine learning #VSSML16 A Gentle Introduction to Machine Learning September 2016 24 / 56
  • 25. Every Little Bit Counts • Market activity modeling (buy/sell at a given time) • Recognition tasks that are “easy” (handwriting detection) • Churn prediction? • Any time there’s a performance critical hand-built system #VSSML16 A Gentle Introduction to Machine Learning September 2016 25 / 56
  • 26. When is this a Bad idea? • Human experts are relatively cheap and easy to come by Natural language processing for stock traders Automatic defect detection in printer operation • A program is easily written by hand Some simple if-then rules often perform well The best program is the one that’s already there • The data is difficult or expensive to acquire Medical domains Automatic processing of images #VSSML16 A Gentle Introduction to Machine Learning September 2016 26 / 56
  • 27. Outline 1 A Machine Learning Fable 2 Machine Learning: Some Intuition 3 School Overview 4 The Basic Idea: Create a Program From Data 5 Modeling 6 Do More With Your Model 7 Evaluation #VSSML16 A Gentle Introduction to Machine Learning September 2016 27 / 56
  • 28. Searching in Hypothesis Space • Machine learning algorithms don’t exactly create a program • More accurately, they search for a program consistent with the training data Search must be very clever Usually there is some sort of “Occam’s razor” involved • The space of possible solutions in which the algorithm search is called its hypothesis space • The algorithm is trying to do “reverse science”! #VSSML16 A Gentle Introduction to Machine Learning September 2016 28 / 56
  • 29. Some Hypothesis Spaces • Logistic regression: Sets of all possible feature coefficients and a bias term • Neural network: Weights for all nodes in the network • Support vector machines: Coefficients on each training point • Note: Parametric vs. Non-parametric #VSSML16 A Gentle Introduction to Machine Learning September 2016 29 / 56
  • 30. A Simple Hypothesis Space Consider thresholds on a single variable, and predict “majority class” of the resulting subsets #VSSML16 A Gentle Introduction to Machine Learning September 2016 30 / 56
  • 31. A Simple Hypothesis Space Visits to Website > 0 #VSSML16 A Gentle Introduction to Machine Learning September 2016 31 / 56
  • 32. A Simple Hypothesis Space Minutes > 200 #VSSML16 A Gentle Introduction to Machine Learning September 2016 32 / 56
  • 33. A Simple Hypothesis Space Last Bill > $180 #VSSML16 A Gentle Introduction to Machine Learning September 2016 33 / 56
  • 34. Good Question • Subset purity • Large difference between the prior and posterior objective distributions • How to find the best question? Try them all! #VSSML16 A Gentle Introduction to Machine Learning September 2016 34 / 56
  • 35. Expanding the Space There’s no reason to stop at just one question: Last Bill > $180 #VSSML16 A Gentle Introduction to Machine Learning September 2016 35 / 56
  • 36. Expanding the Space There’s no reason to stop at just one question: Last Bill > $180 AND Support Calls > 0 #VSSML16 A Gentle Introduction to Machine Learning September 2016 36 / 56
  • 37. The Decision Tree • Why stop at two? • Suggests a recursive algorithm: Choose a threshold Partition the data into subsets Choose a threshold for the subsets, and so on • This is a decision tree #VSSML16 A Gentle Introduction to Machine Learning September 2016 37 / 56
  • 38. Visualizing a Decision Tree • Each node in the tree represents a threshold; a question asked of the data • Branches leading from the node indicate the two or more paths data could take • Thickness of the branches indicates the amount of training data that took that path • At the leaf or terminal node, we decide on a prediction; usually the majority class for the subset at that leaf. #VSSML16 A Gentle Introduction to Machine Learning September 2016 38 / 56
  • 39. When to Stop? • How do we know when to stop splitting the data? • Several possible criteria: When the subset is totally pure (Note: Subsets of size 1 are trivially pure) When the size reaches a predetermined minimum When the number of nodes or tree depth is too large When you can’t get any statistically significant improvement • Nodes that don’t meet the latter criteria can be removed after tree construction via pruning #VSSML16 A Gentle Introduction to Machine Learning September 2016 39 / 56
  • 40. Predicting Using a Decision Tree • The process of building the tree from the training data is called learning, induction, or training. • The payoff of using the tree for prediction is inference, prediction, or scoring. • To do prediction with a tree, given an instance: Start at the root node, subjecting the instance to the threshold “Send” the instance down the appropriate path, to the next threshold Continue until you reach a terminal node, then make a prediction #VSSML16 A Gentle Introduction to Machine Learning September 2016 40 / 56
  • 41. Outline 1 A Machine Learning Fable 2 Machine Learning: Some Intuition 3 School Overview 4 The Basic Idea: Create a Program From Data 5 Modeling 6 Do More With Your Model 7 Evaluation #VSSML16 A Gentle Introduction to Machine Learning September 2016 41 / 56
  • 42. Prediction Confidence - Intuition • Each terminal node return a prediction . . . • . . . but are some terminal nodes “better” than others? • Given a terminal node, how “confident” are we (perhaps for ranking)? • Depends on two things: The number of instances that reach that terminal node The purity of that subset • Think of each terminal node as a “mixture of experts” #VSSML16 A Gentle Introduction to Machine Learning September 2016 42 / 56
  • 43. Prediction Confidence - Calculation • Compute a 95% confidence bound about the probability implied by the terminal node subset • The Wilson score interval: ˆp + 1 2n z2 ± z ˆp(1−ˆp) n + z2 4n2 1 + 1 nz2 • Use the lower bound as the confidence • Similarish for regression models #VSSML16 A Gentle Introduction to Machine Learning September 2016 43 / 56
  • 44. Field Importance - Intuition • Which fields drive the model predictions the most? • Why might we want to know? Improve data collection practices Reduce the number of features in your model Model validation (Watch out for data leakage: objective in the training data) • Depends on two things: Number of times the node uses that feature for the threshold How much it “matters” when it’s used #VSSML16 A Gentle Introduction to Machine Learning September 2016 44 / 56
  • 45. Field Importance - Calculation • For each node in the tree: Compute the error of the prediction in the subset at that node (before) Compute the error of the two child subsets (after) Compute the improvement (the difference between the two) • Sum up the improvements for all nodes corresponding to a given feature #VSSML16 A Gentle Introduction to Machine Learning September 2016 45 / 56
  • 46. Outline 1 A Machine Learning Fable 2 Machine Learning: Some Intuition 3 School Overview 4 The Basic Idea: Create a Program From Data 5 Modeling 6 Do More With Your Model 7 Evaluation #VSSML16 A Gentle Introduction to Machine Learning September 2016 46 / 56
  • 47. Evaluating Your Model • You want to know if your model is good before putting it in production • In your data, you know the right answer! • So use the data to test how often your model is right #VSSML16 A Gentle Introduction to Machine Learning September 2016 47 / 56
  • 48. Don’t Evaluate on the Training Data! • Never train and test on the same data • Many non-parametric models are able to memorize the training data • This results in evaluations that are sometimes wildly optimistic (which is the worst) • Solution: Split your data into training and testing subsets (80% and 20% is customary) #VSSML16 A Gentle Introduction to Machine Learning September 2016 48 / 56
  • 49. Watch out For Luck! • Even splitting your data is sometimes not enough • You may draw an “easy” subset (especially possible with small data) • Can be disastrous if the “edge” you’re expecting is small • Solution: Do multiple runs and average (or cross-validate) #VSSML16 A Gentle Introduction to Machine Learning September 2016 49 / 56
  • 50. Accuracy Can Be Misleading • The top-line evaluation number is accuracy; the number of correct predictions divided by the number of total predictions • Accuracy can be misleading! Suppose only 5% of my customers churn every month Suppose I just predict “no churn” for everybody Ta-da! 95% accuracy! But I get the same 95% accuracy if predict all “churn” instances correct with a 50% false positive rate! • Lesson: Accuracy is broken when classes are unbalanced #VSSML16 A Gentle Introduction to Machine Learning September 2016 50 / 56
  • 51. The Confusion Matrix • What to do if accuracy isn’t what you want? • Look at the specific types of mistakes the algorithm makes • This is the confusion matrix #VSSML16 A Gentle Introduction to Machine Learning September 2016 51 / 56
  • 52. Aside: What If You Don’t Like it? • You see your confusion matrix and it’s making “the wrong mistakes” (maybe you can even confirm by looking at the model) • Often this is caused by unbalanced data; data where one class dominates the dataset • You suspect that a trade-off could be made • Using weights is a good way to do this • A good place to start is often balancing the objective #VSSML16 A Gentle Introduction to Machine Learning September 2016 52 / 56
  • 53. But What if You Want Just One Number? • For model selection, you usually want a single number for a direct comparison • There are other functions of the confusion matrix besides accuracy • BigML provides a few of these: Φ-coefficient (common in soft sciences) F1-score (information retrieval, where there’s a rare positive class) Balanced Accuracy (accuracy, averaged class-wise by inverse frequency) #VSSML16 A Gentle Introduction to Machine Learning September 2016 53 / 56
  • 54. The Right Thing is Always The Right Thing • None of these things are better in general than any other • In your domain, it might be best to come up with your own function • A common form is the cost matrix: How much does a mistake of each type cost: Total cost = cFPnFP + cFNnFN where cx is the cost of a mistake of type x (false positive or false negative), and nx is the number of mistakes of that type. • This is an important part of what you, the domain expert, bring to the table! Don’t ignore it! #VSSML16 A Gentle Introduction to Machine Learning September 2016 54 / 56
  • 55. Regression Evaluation: Generally Less Fraught • To evaluate regression models, we first measure how much error we would have if we just predicted the mean objective for the whole dataset • This functions as a baseline • How much (as a fraction) of the baseline error does the model eliminate? 1.0 is best 0.0 is not good at all And of course, we can go negative • This is R2 • What is “good?” Again, this is domain-specific, but at least improvement with R2 is usually fairly monotonic #VSSML16 A Gentle Introduction to Machine Learning September 2016 55 / 56
  • 56. Fin! Questions? #VSSML16 A Gentle Introduction to Machine Learning September 2016 56 / 56