Machine Learning Midterm Exam Graded A+
Accuracy - ANSWER-number of correctly classified instances divided by total number of
instances
All Pairs - ANSWER-Used for multiclass classification. Trains a Binary Classifier for
every pair of classes. Whichever class "wins" more pairwise classifications will be the
final prediction
All pairs faster to train than OVR. OVR is faster in making predictions - ANSWER--
Averaging precision/recall/f1 - ANSWER-- Macro average: averages the individual
calculated scores of each class. Weights each class equally.
PREmacro = (PRE1 + ...+ PREk)/k
- Micro average: calculates metric by first pooling all instances of each class. Weights
each instance equally.
PREmicro = (TP1+...+TPk)/(TP1+...+ TPk + FP1+...+ FPk)
Benefits of multiple held-out estimates - ANSWER-- more robust final estimate; less
sensitive to particular test split
- multiple estimates also give you variance of the estimates; can be used to construct
confidence intervals
Bias - ANSWER-- When you estimate a parameter from a sample, the estimator is
biased if the expected value of the parameter is different from the true value
- Regularization adds bias because it systematically pushes your estimates in a certain
direction (weights close to 0)
Bias and Variance Error - ANSWER-- Variance is error due to randomness in how your
training data was selected
- Bias is error due to something systematic, not random
- Some amount of bias is needed to avoid overfitting
- too much bias is bad, but too much variance is usually worse
Bias term in perceptron - ANSWER-Add an extra feature to every instance whose value
is always 1
Classification with logistic regression - ANSWER-- typically you classify something as
positive if Φ(z)>=0.5, but you could create other rules. For example, if you dont want to
classify something as positive unless you are really confident, use Φ(z)>=0.99 as your
rule (example:// spam classification)
, Data annotation - ANSWER-Creating the labels for training data
also called coding or labeling
often needs to be an iterative process to finalize guidelines and set of labels
Data Preprocessing - ANSWER-Preprocessing refers to the step of processing your raw
data in a way that makes it suitable for use in a learning algorithm
Main components:
- Getting features out of raw data
- setting values of the features (fixing incorrect values, converting categorical values to
numeric, standardizing/normalizing values)
- selecting which instances to include
Decision Tree Benefits - ANSWER-- Decision trees can learn conjunctions (e.g.,
pattern="striped" AND Color="Orange"). This gives context to the feature values.
- Naturally handle muticlass classification without modification
- Classifier is interpretable
- Can be used for regression (final prediction is the average value of all instances at
leaf)
Decision trees - ANSWER-Decision tree classifiers are structured as trees, where:
- nodes are features
- edges are feature values
- leaves are classes
To classify an instance, start at the root of the tree, and follow the branches based on
the feature values in that instance. The final node is the prediction.
Dimensionality - ANSWER-- Dimensionality: number of features/variables
- Curse of dimensionality:
training: the more features you have, the more data you need to learn
distance: all points are far apart in a high dimensional space. Harder to define close vs
far
Dimensionality reduction - ANSWER-- Dimensionality reduction refers to the process of
reducing the number of features in your data: can be done through feature selection and
feature transformation
- transformed feature vectors are called embeddings
Accuracy - ANSWER-number of correctly classified instances divided by total number of
instances
All Pairs - ANSWER-Used for multiclass classification. Trains a Binary Classifier for
every pair of classes. Whichever class "wins" more pairwise classifications will be the
final prediction
All pairs faster to train than OVR. OVR is faster in making predictions - ANSWER--
Averaging precision/recall/f1 - ANSWER-- Macro average: averages the individual
calculated scores of each class. Weights each class equally.
PREmacro = (PRE1 + ...+ PREk)/k
- Micro average: calculates metric by first pooling all instances of each class. Weights
each instance equally.
PREmicro = (TP1+...+TPk)/(TP1+...+ TPk + FP1+...+ FPk)
Benefits of multiple held-out estimates - ANSWER-- more robust final estimate; less
sensitive to particular test split
- multiple estimates also give you variance of the estimates; can be used to construct
confidence intervals
Bias - ANSWER-- When you estimate a parameter from a sample, the estimator is
biased if the expected value of the parameter is different from the true value
- Regularization adds bias because it systematically pushes your estimates in a certain
direction (weights close to 0)
Bias and Variance Error - ANSWER-- Variance is error due to randomness in how your
training data was selected
- Bias is error due to something systematic, not random
- Some amount of bias is needed to avoid overfitting
- too much bias is bad, but too much variance is usually worse
Bias term in perceptron - ANSWER-Add an extra feature to every instance whose value
is always 1
Classification with logistic regression - ANSWER-- typically you classify something as
positive if Φ(z)>=0.5, but you could create other rules. For example, if you dont want to
classify something as positive unless you are really confident, use Φ(z)>=0.99 as your
rule (example:// spam classification)
, Data annotation - ANSWER-Creating the labels for training data
also called coding or labeling
often needs to be an iterative process to finalize guidelines and set of labels
Data Preprocessing - ANSWER-Preprocessing refers to the step of processing your raw
data in a way that makes it suitable for use in a learning algorithm
Main components:
- Getting features out of raw data
- setting values of the features (fixing incorrect values, converting categorical values to
numeric, standardizing/normalizing values)
- selecting which instances to include
Decision Tree Benefits - ANSWER-- Decision trees can learn conjunctions (e.g.,
pattern="striped" AND Color="Orange"). This gives context to the feature values.
- Naturally handle muticlass classification without modification
- Classifier is interpretable
- Can be used for regression (final prediction is the average value of all instances at
leaf)
Decision trees - ANSWER-Decision tree classifiers are structured as trees, where:
- nodes are features
- edges are feature values
- leaves are classes
To classify an instance, start at the root of the tree, and follow the branches based on
the feature values in that instance. The final node is the prediction.
Dimensionality - ANSWER-- Dimensionality: number of features/variables
- Curse of dimensionality:
training: the more features you have, the more data you need to learn
distance: all points are far apart in a high dimensional space. Harder to define close vs
far
Dimensionality reduction - ANSWER-- Dimensionality reduction refers to the process of
reducing the number of features in your data: can be done through feature selection and
feature transformation
- transformed feature vectors are called embeddings