PSTAT 131 Final Exam Study Guide
Questions With Correct Answers
ML |Workflow |- |VERIFIED |ANSWER✔✔-goal, |data, |learn, |evaluate
Predictors |are |also |called |- |VERIFIED |ANSWER✔✔-(inputs, |features, |covariates, |independent |variables)
response |is |also |called |- |VERIFIED |ANSWER✔✔-(output, |target, |dependent |variable)
Learner |vs |Supervisor |- |VERIFIED |ANSWER✔✔-machine |is |the |learner, |Y |(response) |is |the |supervisor
Supervised |learning |- |VERIFIED |ANSWER✔✔-need |predictors |and |response:
- |prediction, |estimation, |model |selection, |inference
- |regression |and |classification
Unsupervised |Learning |- |VERIFIED |ANSWER✔✔-goal: |to |find |predictors |that |behave |similarly |without |
learning |from |a |teacher, |or |for |a |Y
Supervised |learning |examples |- |VERIFIED |ANSWER✔✔-logistic |regression, |decision |tree, |k-nearest |
neighbors, |naive |bayes, |linear |regression, |ridge, |lasso, |SVM, |NN
Unsupervised |learning |examples |- |VERIFIED |ANSWER✔✔-PCA, |NBSCAN, |hierarchical |clustering, |k-
means |clustering, |Gaussian |Mixtures
Why |should |we |ever |choose |a |less |flexible |method |over |a |flexible |one? |- |VERIFIED |ANSWER✔✔-
Better |interpretability, |and |sometimes |even |smaller |error |(overfitting)
flexibility |vs |interpretability |of |subset |selection, |lasso, |least |squares, |trees, |bagging, |boosting, |SVM, |
NN |- |VERIFIED |ANSWER✔✔-subset |selection/Lasso |= |High |Interpretability, |Low |Flex
,Least |squares/trees |= |mid |for |both
bagging/boosting |, |SVM, |NN |= |High |flex, |low |interpretability
what |does |it |mean |when |a |model |is |flexible/complex? |- |VERIFIED |ANSWER✔✔-specific |to |training |
data |(too |flexible |may |result |in |overfitting)
Training |MSE |- |VERIFIED |ANSWER✔✔-1/n |sum{ |(y_i |- |f_hat(x_i))^2
- |average |square |difference |between |actual |and |predicted |value
- |y_i |is |the |actual |value, |y_i_hat |is |predicted |value |at |i-th |X
Test |MSE |- |VERIFIED |ANSWER✔✔-1/n |sum{ |(y_i |- |f_hat(x_i))^2
- |average |square |difference |between |actual |and |predicted |value
- |y_i |is |the |actual |value, |y_i_hat |is |the |predicted |value |of |the |target |variable |for |the |i-th |data |point |in
|the |test |set.
- |we |want |model |with |lowest |test |MSE
Overfitting |- |VERIFIED |ANSWER✔✔-- |training |MSE |is |low, |but |test |MSE |is |high
Cross-Validation |- |VERIFIED |ANSWER✔✔-method |for |estimating |test |MSE |and |test |error |using |only |
training |data
Bias-Variance |Decomposition |- |VERIFIED |ANSWER✔✔-Expected |test |MSE |= |variance |+ |bias^2 |+ |
Var(epsilon)
- |Var(epsilon) |= |irreducible |error
,- |it |is |often |not |feasible |to |evaluate |a |model |on |all |possible |test |datasets, |so |the |concept |of |expected |
test |MSE |is |used |to |represent |the |average |performance |of |a |model |on |new, |unseen |data
- |Expected |MSE |accounts |for |variability |in |performance |that |may |arise |due |to |different |random |
samples |in |the |test |data.
- |joint |distribution |of |(X,Y) |is |unknown |in |practice |
- |Y |= |f(x) |+ |Epsilon, |where |f(x) |is |non-random |and |epsilon |is |zero-mean |noise
- |MSE |= |E[(Y |- |f(x)^hat)^2]
Bias |- |VERIFIED |ANSWER✔✔-error |that |is |introduced |by |approximating |a |real-life |problem
ex: |real |relationship |between |response |and |predictors |is |nonlinear, |but |we |fit |a |linear |model, |which |
causes |bias
simple |model |= |high |bias |+ |low |variance |
flexible |model |= |low |bias |+ |high |variance
Bias(f_hat(x_0)) |= |E[f_hat(x_0)] |- |f(x_0)
Variance |- |VERIFIED |ANSWER✔✔-the |amount |by |which |f |̂ |model |change |if |we |estimated |it |using |a |
different |training |set
Variance(f_hat(x_0)) |= |E[((f_hat(x_0)-E(f_hat(x_0))^2]
Training |Error |Rate |- |VERIFIED |ANSWER✔✔-fraction |of |incorrect |classifications |in |training |set
, Test |error |rate |- |VERIFIED |ANSWER✔✔-fraction |of |incorrect |classifications |on |test |set |
- |predicted |class |labels |that |the |model |gives |for |i-th |test |observation |that |doesn't |match |i_th |test |
response |value
training/test |MSE |vs |training/test |error |- |VERIFIED |ANSWER✔✔-MSE |used |for |regression, |error |used |
for |classification
Bayes |Classifier |- |VERIFIED |ANSWER✔✔-- |assigns |each |observation |to |the |most |likely |class, |given |
predictor |values
- |produces |lowest |possible |test |error |rate |
- |still |makes |mistakes
- |bayes |error |rate: |1- |E[maxProb(Y |= |j || |X)]
k-nearest |neighbors |- |VERIFIED |ANSWER✔✔-- |used |when |we |don't |know |conditional |distribution |Y|X |
- |good |for |small |p |(<= |4) |and |large |n
- |non-parametric |method |
Classification:
if |k |increases, |variance |decreases, |bias^2 |increases, |var(e) |out |of |control
if |k |decreases, |variance |increases, |bias^2 |decreases, |var(e) |out |of |control
What |is |the |curse |of |dimensionality? |- |VERIFIED |ANSWER✔✔-High |dimensionality |makes |clustering |
hard, |because |having |lots |of |dimensions |means |that |everything |is |"far |away" |from |each |other. |... |use |
PCA
Prediction |Error |vs |model |complexity |graph |- |VERIFIED |ANSWER✔✔-test |error: |U |shaped
Questions With Correct Answers
ML |Workflow |- |VERIFIED |ANSWER✔✔-goal, |data, |learn, |evaluate
Predictors |are |also |called |- |VERIFIED |ANSWER✔✔-(inputs, |features, |covariates, |independent |variables)
response |is |also |called |- |VERIFIED |ANSWER✔✔-(output, |target, |dependent |variable)
Learner |vs |Supervisor |- |VERIFIED |ANSWER✔✔-machine |is |the |learner, |Y |(response) |is |the |supervisor
Supervised |learning |- |VERIFIED |ANSWER✔✔-need |predictors |and |response:
- |prediction, |estimation, |model |selection, |inference
- |regression |and |classification
Unsupervised |Learning |- |VERIFIED |ANSWER✔✔-goal: |to |find |predictors |that |behave |similarly |without |
learning |from |a |teacher, |or |for |a |Y
Supervised |learning |examples |- |VERIFIED |ANSWER✔✔-logistic |regression, |decision |tree, |k-nearest |
neighbors, |naive |bayes, |linear |regression, |ridge, |lasso, |SVM, |NN
Unsupervised |learning |examples |- |VERIFIED |ANSWER✔✔-PCA, |NBSCAN, |hierarchical |clustering, |k-
means |clustering, |Gaussian |Mixtures
Why |should |we |ever |choose |a |less |flexible |method |over |a |flexible |one? |- |VERIFIED |ANSWER✔✔-
Better |interpretability, |and |sometimes |even |smaller |error |(overfitting)
flexibility |vs |interpretability |of |subset |selection, |lasso, |least |squares, |trees, |bagging, |boosting, |SVM, |
NN |- |VERIFIED |ANSWER✔✔-subset |selection/Lasso |= |High |Interpretability, |Low |Flex
,Least |squares/trees |= |mid |for |both
bagging/boosting |, |SVM, |NN |= |High |flex, |low |interpretability
what |does |it |mean |when |a |model |is |flexible/complex? |- |VERIFIED |ANSWER✔✔-specific |to |training |
data |(too |flexible |may |result |in |overfitting)
Training |MSE |- |VERIFIED |ANSWER✔✔-1/n |sum{ |(y_i |- |f_hat(x_i))^2
- |average |square |difference |between |actual |and |predicted |value
- |y_i |is |the |actual |value, |y_i_hat |is |predicted |value |at |i-th |X
Test |MSE |- |VERIFIED |ANSWER✔✔-1/n |sum{ |(y_i |- |f_hat(x_i))^2
- |average |square |difference |between |actual |and |predicted |value
- |y_i |is |the |actual |value, |y_i_hat |is |the |predicted |value |of |the |target |variable |for |the |i-th |data |point |in
|the |test |set.
- |we |want |model |with |lowest |test |MSE
Overfitting |- |VERIFIED |ANSWER✔✔-- |training |MSE |is |low, |but |test |MSE |is |high
Cross-Validation |- |VERIFIED |ANSWER✔✔-method |for |estimating |test |MSE |and |test |error |using |only |
training |data
Bias-Variance |Decomposition |- |VERIFIED |ANSWER✔✔-Expected |test |MSE |= |variance |+ |bias^2 |+ |
Var(epsilon)
- |Var(epsilon) |= |irreducible |error
,- |it |is |often |not |feasible |to |evaluate |a |model |on |all |possible |test |datasets, |so |the |concept |of |expected |
test |MSE |is |used |to |represent |the |average |performance |of |a |model |on |new, |unseen |data
- |Expected |MSE |accounts |for |variability |in |performance |that |may |arise |due |to |different |random |
samples |in |the |test |data.
- |joint |distribution |of |(X,Y) |is |unknown |in |practice |
- |Y |= |f(x) |+ |Epsilon, |where |f(x) |is |non-random |and |epsilon |is |zero-mean |noise
- |MSE |= |E[(Y |- |f(x)^hat)^2]
Bias |- |VERIFIED |ANSWER✔✔-error |that |is |introduced |by |approximating |a |real-life |problem
ex: |real |relationship |between |response |and |predictors |is |nonlinear, |but |we |fit |a |linear |model, |which |
causes |bias
simple |model |= |high |bias |+ |low |variance |
flexible |model |= |low |bias |+ |high |variance
Bias(f_hat(x_0)) |= |E[f_hat(x_0)] |- |f(x_0)
Variance |- |VERIFIED |ANSWER✔✔-the |amount |by |which |f |̂ |model |change |if |we |estimated |it |using |a |
different |training |set
Variance(f_hat(x_0)) |= |E[((f_hat(x_0)-E(f_hat(x_0))^2]
Training |Error |Rate |- |VERIFIED |ANSWER✔✔-fraction |of |incorrect |classifications |in |training |set
, Test |error |rate |- |VERIFIED |ANSWER✔✔-fraction |of |incorrect |classifications |on |test |set |
- |predicted |class |labels |that |the |model |gives |for |i-th |test |observation |that |doesn't |match |i_th |test |
response |value
training/test |MSE |vs |training/test |error |- |VERIFIED |ANSWER✔✔-MSE |used |for |regression, |error |used |
for |classification
Bayes |Classifier |- |VERIFIED |ANSWER✔✔-- |assigns |each |observation |to |the |most |likely |class, |given |
predictor |values
- |produces |lowest |possible |test |error |rate |
- |still |makes |mistakes
- |bayes |error |rate: |1- |E[maxProb(Y |= |j || |X)]
k-nearest |neighbors |- |VERIFIED |ANSWER✔✔-- |used |when |we |don't |know |conditional |distribution |Y|X |
- |good |for |small |p |(<= |4) |and |large |n
- |non-parametric |method |
Classification:
if |k |increases, |variance |decreases, |bias^2 |increases, |var(e) |out |of |control
if |k |decreases, |variance |increases, |bias^2 |decreases, |var(e) |out |of |control
What |is |the |curse |of |dimensionality? |- |VERIFIED |ANSWER✔✔-High |dimensionality |makes |clustering |
hard, |because |having |lots |of |dimensions |means |that |everything |is |"far |away" |from |each |other. |... |use |
PCA
Prediction |Error |vs |model |complexity |graph |- |VERIFIED |ANSWER✔✔-test |error: |U |shaped