MARK MIRCHANDANI: So you want to harness the power of machine
learning for your business.
Well, one of the first problems you'll need to solve
is what data you'll be using to teach your models.
So you guys have like a mantra, right?
SPEAKER: Yes no data, no ML.
MARK MIRCHANDANI: What does that mean exactly?
SPEAKER: Well, your model is only
as good as the data it trains on.
MARK MIRCHANDANI: Luckily, our professional services
ML team has refined a set of best practices
for selecting and preparing top quality data.
And we're itching to hand the goods over.
SPEAKER: Is this the part where we tell them
all of our secrets?
MARK MIRCHANDANI: That comes up in a little bit later.
First, we'll reveal what goes into choosing
a highly effective data source, and later,
learn how to spot the most common oversights
our professional services ML team helps correct for clients.
So ready to become an independent authority
on good data?
Let's dive in.
Rule number 1, clear labels.
Many companies use machine learning
because they want to predict some outcome,
from detecting credit card fraud to forecasting ice cream sales,
from recommendation systems to self-driving cars.
Whatever it is you're trying to predict,
you'll need to feed the machine some examples
with known outcomes.
We call those labels.
If you were teaching a machine how
to predict credit card fraud, for instance,
you would tell the machine for each new piece of data
whether or not fraud occurred.
This is what we mean by known outcomes.
It may seem like a small point, but for businesses looking
to take advantage of ML to make accurate predictions,
these labeled examples are what allow algorithms
to learn in the first place.
SPEAKER: I would say this is probably
the number one piece of advice we give to our clients.
MARK MIRCHANDANI: Labels?
SPEAKER: Labels, labels, labels.
MARK MIRCHANDANI: Is there anything else?
SPEAKER: Well, although more data is generally better,
it has to be the right kind of data.
MARK MIRCHANDANI: That sounds pretty important.
Maybe like rule number two important?
Rule number 2, although more data is generally better,
it has to be the right kind of data.
Continuing with our example, if you want your algorithm
to predict credit card fraud, imagine all the information
a human being might rely on to do the same task.
Data like the amount of the transaction
and where it took place are definitely
useful, but cardholder name?
That may not be as helpful here.
If you're not sure, erring on the side of more data
is always wise.
In the world of machine learning,
we don't always know with 100% certainty what's going
to be relevant ahead of time.
Expect to refine as you go.
Sometimes relevant also means granular.
Suppose you wanted to predict weather on an hourly basis,
but your data is only collected daily, let's say 3:00 PM.
Your model will learn how to predict the weather, sure.
But except for those of us who decide
what to wear based on the temperature outside at exactly
3:00 PM, the model won't be as helpful as it could be.
This also means collecting data long enough.
So if the target you're trying to predict
is periodic, like ice cream sales,
you'll need enough cycles for your model
to discover the general trend.
A good rule of thumb is at least three.
This table includes plenty of helpful columns,
but which one that ML models depend on to make accurate
predictions is still missing.
[CLOCK TICKING]
You guessed labels, right?
Just checking.
Rule number 3, beware of biased data.
Granularity matters.
But some errors only become obvious
when we take a big step backwards.
It's just like how we can tell when a picture
frame is leaning to one side when
we're standing far enough away.
Here, we'll define bias as anytime
you're training data skews towards some groups
more than the rest.
Let's say you're trying to predict customer satisfaction.
Well, we know that online reviews
tend to overrepresent the most extreme views.
So if you choose to train a model on these reviews alone,
your model could become biased.
Now, don't be alarmed if you have missing values
in a large data set.
But you should check to see whether these missing
values frequently leave out the same group.
You might think that simply collecting more data
will solve the problem, but that's not always possible.
And even if it were, that's only a part of the solution.
Just as important, if you have a way
to tell what dynamics are causing the bias,
you may still be able to quantify the effect
and correct it by, for example, adjusting
the weighing and different samples accordingly.
Expect to do some corrections of your data
set, and don't let perfect be the enemy of great.
Congratulations, you're more than halfway
to maximizing the power of your training data.
Now let's finish strong with some data preparation.
Rule number 4, use consistent terms.
You'll want to make sure you're using the same units
across your data set.
Check not only for quantitative units like price,
but for categorical units as well.
This also means making sure the meaning of the data in a given
column is consistent.
If a single price column switches between wholesale
and retail price, and you're missing a column that
identifies which is which, your model will treat these numbers
as though they measure the same thing, even though they don't.
Rule number 5, out-think data leakage.
Data leakage happens when you train your model on information
that won't be available when it's time for your model
to actually do its job.
So here's my favorite example.
Let's say you're teaching a model
to pick out which acoustic recordings contain calls
from an endangered species of whale.
[WHALE CALL]
What if the recordings with the right audio
happened to be the same file size, but only
due to some processing that was done on them?
Your model could learn to rely on file size instead of sound,
and later, when it's time to start making predictions,
label all kinds of sounds as whale.
Almost done.
Let's quickly review the basic principles.
Labels, labels, labels; more data is good,
but it has to be the right kind; beware of biased data;
use consistent terms throughout your spreadsheets;
and rule out data leakage.
And voila, you're ready to select the right data
and make sure it's cooked and good for your machine learning
algorithm.
For a more detailed explanation, check out
the full article on the Google Cloud Platform blog
and find the link to our ML data prep check list at the bottom.
Have a tip you'd like to share with us?
Join the conversation on our Twitter
handle using #mldataprep.
And as always, thanks for watching.
[MUSIC PLAYING]