MSCI 446 Midterm Practice Questions With Complete
Solutions
Explain Document Term Vectors Correct Answers o A
fragment of vector from a short document with text
o Unlocks machine learning algorithms that previously required
numeric values
o Consequence: Fails to recognize words that have similar
semantics because they have different spellings
o Bert model: word embeddings
Explain One Hot Encoding Correct Answers Categorical ->
Boolean/Binary: If the categorical variable has k values, one hot
encoding creates k Boolean variables, one of which will be true
in any one record
For n sets, what is the range of confidence? Correct Answers 0
to 1
For n sets, what is the range of support? Correct Answers 0 to n
Goodness of Fit: Residual Distribution Correct Answers ·
Should be symmetric about 0
· Y: Relative frequency
· What if 0 but not high frequency - get most out of data
· Overestimates/underestimates in some cases -> not skewed
(bad fit)
Goodness of Fit: Residual Plot Correct Answers · Pattern
· No pattern
· Negative (model overestimates)
, · Value of x and corresponding residual
How do you calculate Euclidian distance for numeric vectors (a,
b) and (c, d)? Correct Answers sqrt((a-c)^2 + (b-d)^2)
How do you calculate Manhattan distance for numeric vectors
(a, b) and (c, d)? Correct Answers |a-c|+|b-d|
How do you prevent overfitting? Correct Answers -don't
penalize model on getting outliers wrong
o Restrict space of hypotheses tested
o Regularization - make less precise/simpler
o Sacrifices accuracy (from optimization standpoint) to achieve
overfitting - better performance for future by "dumbing down"
past
How does email spam filtering work? Correct Answers Input:
examples of legitimate emails and spam emails
Output: a program that predicts whether a given email is
legitimate or spam - could be very bad depending on how
general the learning is (i.e. keywords vs. exact sentences)
How would you calculate weights for document term vectors?
Correct Answers 10/(log(count))
Mean Squared Error (MSE) Correct Answers
Residual Sum of Squares Correct Answers
Solutions
Explain Document Term Vectors Correct Answers o A
fragment of vector from a short document with text
o Unlocks machine learning algorithms that previously required
numeric values
o Consequence: Fails to recognize words that have similar
semantics because they have different spellings
o Bert model: word embeddings
Explain One Hot Encoding Correct Answers Categorical ->
Boolean/Binary: If the categorical variable has k values, one hot
encoding creates k Boolean variables, one of which will be true
in any one record
For n sets, what is the range of confidence? Correct Answers 0
to 1
For n sets, what is the range of support? Correct Answers 0 to n
Goodness of Fit: Residual Distribution Correct Answers ·
Should be symmetric about 0
· Y: Relative frequency
· What if 0 but not high frequency - get most out of data
· Overestimates/underestimates in some cases -> not skewed
(bad fit)
Goodness of Fit: Residual Plot Correct Answers · Pattern
· No pattern
· Negative (model overestimates)
, · Value of x and corresponding residual
How do you calculate Euclidian distance for numeric vectors (a,
b) and (c, d)? Correct Answers sqrt((a-c)^2 + (b-d)^2)
How do you calculate Manhattan distance for numeric vectors
(a, b) and (c, d)? Correct Answers |a-c|+|b-d|
How do you prevent overfitting? Correct Answers -don't
penalize model on getting outliers wrong
o Restrict space of hypotheses tested
o Regularization - make less precise/simpler
o Sacrifices accuracy (from optimization standpoint) to achieve
overfitting - better performance for future by "dumbing down"
past
How does email spam filtering work? Correct Answers Input:
examples of legitimate emails and spam emails
Output: a program that predicts whether a given email is
legitimate or spam - could be very bad depending on how
general the learning is (i.e. keywords vs. exact sentences)
How would you calculate weights for document term vectors?
Correct Answers 10/(log(count))
Mean Squared Error (MSE) Correct Answers
Residual Sum of Squares Correct Answers