DSCI 100 FINAL EXAM STUDY GUIDE
Underfitting in classification - Answers - Increased number of neighbours means that
more observations are influencing the classification. This smooths out the boundaries
between each class, so the model isn't influenced enough by the training data.
Underfitting in KNN regression - Answers - Increased K values means that more
observations are influencing the regression line, which can cause the line to become
flat. Since the regression no longer follows the training observations, accuracy in
predicting training datapoints decreases.
Overfitting in classification - Answers - Decreased number of neighbours means that
fewer observations are influencing the classification. This makes the boundaries
between classes more jagged and complex, so the model is influenced too much by the
training data. The classifier will just match new observations to the closest neighbour in
the training data set, resulting in high accuracy.
Overfitting in KNN regression - Answers - Decreased K values means that fewer
observations are influencing the regression line, which can cause the line to simply
follow the training data points. Since the regression is perfectly following the training
observations, accuracy in predicting training datapoints increases.
Creating confidence intervals - Answers - bootstrap_means |>
select(mean) |>
pull() |>
quantile(c(0.025, 0.975))
Bootstrapping (concept) - Answers - Given a single sample from a population, you take
a single observation from this sample, record it, then return it to the sample. This is
sampling with replacement. This should be repeated until the bootstrap sample is the
same size as the original sample. Now, you should be able to calculate the mean or
proportion from the bootstrap sample. These steps should be repeated many times to
form a bootstrap distribution of means or proportions. This will provide an estimate of
the population parameter, and should resemble the sampling distribution spread.
KNN regression - Answers - - Used to infer a quantitative measurement of a new
observation based on existing observations
- Relatively simple and intuitive, doesn't require much info about the relationship in
advance (can be used on non-linear relationships), can be used for binary or multi-
variable relationships
- Takes a long time for large data sets, performs poorly with many different predictors or
if classes are unbalanced
- Splits data into training and testing data
- Training data can be split further to use cross-validation, which allows you to
determine the best K value to use (determine which one has the highest accuracy)
Underfitting in classification - Answers - Increased number of neighbours means that
more observations are influencing the classification. This smooths out the boundaries
between each class, so the model isn't influenced enough by the training data.
Underfitting in KNN regression - Answers - Increased K values means that more
observations are influencing the regression line, which can cause the line to become
flat. Since the regression no longer follows the training observations, accuracy in
predicting training datapoints decreases.
Overfitting in classification - Answers - Decreased number of neighbours means that
fewer observations are influencing the classification. This makes the boundaries
between classes more jagged and complex, so the model is influenced too much by the
training data. The classifier will just match new observations to the closest neighbour in
the training data set, resulting in high accuracy.
Overfitting in KNN regression - Answers - Decreased K values means that fewer
observations are influencing the regression line, which can cause the line to simply
follow the training data points. Since the regression is perfectly following the training
observations, accuracy in predicting training datapoints increases.
Creating confidence intervals - Answers - bootstrap_means |>
select(mean) |>
pull() |>
quantile(c(0.025, 0.975))
Bootstrapping (concept) - Answers - Given a single sample from a population, you take
a single observation from this sample, record it, then return it to the sample. This is
sampling with replacement. This should be repeated until the bootstrap sample is the
same size as the original sample. Now, you should be able to calculate the mean or
proportion from the bootstrap sample. These steps should be repeated many times to
form a bootstrap distribution of means or proportions. This will provide an estimate of
the population parameter, and should resemble the sampling distribution spread.
KNN regression - Answers - - Used to infer a quantitative measurement of a new
observation based on existing observations
- Relatively simple and intuitive, doesn't require much info about the relationship in
advance (can be used on non-linear relationships), can be used for binary or multi-
variable relationships
- Takes a long time for large data sets, performs poorly with many different predictors or
if classes are unbalanced
- Splits data into training and testing data
- Training data can be split further to use cross-validation, which allows you to
determine the best K value to use (determine which one has the highest accuracy)