Google Machine Learning Crash Course Flashcards
Google ML Crash Course
What is Rule #1 of the Rules of Machine Learning?
Rule #1: Don’t be afraid to launch a product without machine learning.
Google ML Crash Course
What are “labels”
A label is the thing we’re predicting - the y
variable in simple linear regression. The label could be the future price of wheat, the kind of animal shown in a picture, the meaning of an audio clip, or just about anything.
Google ML Crash Course
What variable is often used to represent the label
y
when used for an input label or y'
when used as the predicted label
Google ML Crash Course
What are “features”?
A feature is an input variable - the x
variable in simple linear regression. A simple machine learning project might use a single feature, while a more sophisticated machine learning project could use millions of features, specified as:
x₁, x₂, ..., xₙ
In the spam detector example, the features could include the following:
- words int he email text
- sender’s address
- time of day the email was sent
- if the email contains the phrase “one weird trick.”
Google ML Crash Course
What variable(s) are often used to represent features?
x
or x₁, x₂, ..., xₙ
Google ML Crash Course
What are “examples”?
An example is a particular instance of data, x (we put x in boldface to indicate that it is a vector.) WEe break examples into two categories:
- labeled examples
- unlabeled examples
A labeled example includes both feature(s) and the label. That is:
labeled examples: {features, label}: (x,y)
An unlabeled example contains features but not the label. That is:
unlabeled examples: {features, ?}: (x, ?)
Once we’ve trained our model with labeled examples, we use that model to predict the label on unlabeled examples. In the spam detector, unlabeled examples are new emails that humans haven’t yet labeled.
Google ML Crash Course
What variable(s) are often used to represent an example?
Google ML Crash Course
What is a “model”?
A model defines the relationship between features and label. For example, a spam detection model might associate certain features strongly with “spam”.
Google ML Crash Course
What are phases in a “model“‘s life cycle?
- training means creating, or learning the model
-
inference means applying the trained model to unlabeled examples to make useful predictions (
y'
)
Google ML Crash Course
What is the difference between regression and classification”?
- A regression model predicts continuous values, e.g. the price of a home, or the probability of an event happening.
- A classification model predicts discrete values, e.g., if a given email is spam or not, or what kind of animal a picture is of.
Google ML Crash Course
Suppose you want to develop a supervised machine learning model to predict whether a given email s “spam” or “not spam”. Which of the following statements are true?
- Words in the subject header will make good labels.
- Emails not marked as “spam” or “not spam” are unlabeled examples.
- The labels applied to some examples might be unreliable.
- We’ll use unlabeled examples to train the model.
2 & 3 are true:
- Emails not marked as “spam” or “not spam” are unlabeled examples.
- The labels applied to some examples might be unreliable.
Google ML Crash Course
Suppose an online shoe store wants to create a supervised ML model that will provide personalized show recommendations to users. That is, the model will recommend certain pairs of shoes to Marty and different pairs of shoes to Janet. The system will use past user behavior data to generate training data. Which of the following statements are true?
- “Shoe size” is a useful feature.
- “Shoe beauty” is a useful feature.
- “Shoes that a user adores” is a useful label.
- “The user clicked on the shoe’s description” is a useful label.
1 & 4 are true:
- “Shoe size” is a useful feature. It is quantifiable and will influence if a user likes it or not. E.g. if Marty is a size 9, the model shouldn’t recommend size 7 shoes.
- “The user clicked on the shoe’s description” is a useful label. Users probably only want to read more about shoes they like, or are interested in.
2 & 3 are false:
- “Shoe beauty” is a useful feature. Good features are concrete and quantifiable, but “beauty” is not quantifiable. Style and color might be better features.
- “Shoes that a user adores” is a useful label. Similarly “adorable” is not quantifiable.
Google ML Crash Course
What is the equation for a simple linear regression model with a single feature?
y' = b + w₁x₁
Where:
-
y'
is the predicted label (desired output). -
b
is the bias (the y-intercept), sometimes referred to asw₀
. -
w₁
is the weight of feature 1. Weight is the same concept as the “slope”m
in the traditional equation of a line. -
x₁
is a feature (feature number 1, a known input)
This can be used to infer (predict) the value of y'
for a given value x₁
in a model that has been trained (has learned the values for b
and w₁
)
Google ML Crash Course
If y' = b + w₁x₁
is the equation for a linear regression model with a single feature, what is the equation for a model with three features?
y' = b + w₁x₁ + w₂x₂ + w₃x₃
Google ML Crash Course
What is a simple definition for “Training”
In the context of Supervised Learning
Training a model simply means learning (determining) good values for all the weights and the bias from labeled examples. In supervised learning, a machine learning algorithm builds a model by examining many examples and attempting to find a model that minimizes loss; this process is called empirical risk minimization.