DSCI 100 CORE MAIN ANSWERS AND QUESTIONS
SET A+
✔✔Predict - ✔✔predict(workflow_var, testing data) |>
bind_cols(testing data)
✔✔accuracy - ✔✔# of correct predictions
--------------------------
total # of predictions
✔✔precision - ✔✔# of correct positive predictions
------------------------------------
total # of positive predictions
✔✔recall - ✔✔# of correct positive predictions
------------------------------------
total # of positive test set observations
✔✔Code to get accuracy from prediction variable - ✔✔acc <- cancer_test_predictions |>
metrics(truth = predicted_var, estimate = .pred_class) |>
filter(.metric == "accuracy") |>
select(.estimate) |>
pull()
✔✔Cross-validation - ✔✔A way to see how well your model is working. You can use this
to find the optimal K in KNN.
✔✔Underfitting - ✔✔The model isn't influenced enough by the data. The model is too
simple to understand what is going on with the data.
✔✔Overfitting - ✔✔The model is influenced too much by the data. The model learns too
much and picks up on things it shouldn't have like noise or outliers.
, ✔✔Regression - ✔✔A method to predict new observations based on old ones, but
instead of categorical values (classification), we are predicting numerical values
✔✔Strengths of KNN regression - ✔✔- simple algorithm
- requires only a few assumptions
- works well with non linear relationships
✔✔Weaknesses of KNN regression - ✔✔- becomes slow with larger datasets
- may not perform well with multiple predictors
- may not predict well beyond the numbers of the training data
✔✔RMSPE - ✔✔Root Mean Square Prediction Error for model accuracy.
Used in KNN regression.
small RMSPE = good model
large RMSPE = bad model
✔✔Linear regression - ✔✔Creates a straight line of best fit through the training data and
then "look up" the prediction using a line.
single predictor = a line
two predictors = a plane
Good when: there is a linear ish relationship
Good for:
- predicting new variables
- showing the strength of relationships between variables
✔✔Outliers in linear regression - ✔✔As long as there is enough data, one or two
outliers won't affect it a lot
✔✔Clustering - ✔✔A data analysis technique where you separate a dataset into groups
of related data
✔✔Statistical interference - ✔✔The process of using a sample to make a conclusion
about the broader population from which it is taken
✔✔Population - ✔✔The complete collection of individuals we are interested in studying.
ex. undergrad students at UBC
✔✔Population parameter - ✔✔A numerical characteristic of the entire population
ex. the proportion of population that are iPhone users
SET A+
✔✔Predict - ✔✔predict(workflow_var, testing data) |>
bind_cols(testing data)
✔✔accuracy - ✔✔# of correct predictions
--------------------------
total # of predictions
✔✔precision - ✔✔# of correct positive predictions
------------------------------------
total # of positive predictions
✔✔recall - ✔✔# of correct positive predictions
------------------------------------
total # of positive test set observations
✔✔Code to get accuracy from prediction variable - ✔✔acc <- cancer_test_predictions |>
metrics(truth = predicted_var, estimate = .pred_class) |>
filter(.metric == "accuracy") |>
select(.estimate) |>
pull()
✔✔Cross-validation - ✔✔A way to see how well your model is working. You can use this
to find the optimal K in KNN.
✔✔Underfitting - ✔✔The model isn't influenced enough by the data. The model is too
simple to understand what is going on with the data.
✔✔Overfitting - ✔✔The model is influenced too much by the data. The model learns too
much and picks up on things it shouldn't have like noise or outliers.
, ✔✔Regression - ✔✔A method to predict new observations based on old ones, but
instead of categorical values (classification), we are predicting numerical values
✔✔Strengths of KNN regression - ✔✔- simple algorithm
- requires only a few assumptions
- works well with non linear relationships
✔✔Weaknesses of KNN regression - ✔✔- becomes slow with larger datasets
- may not perform well with multiple predictors
- may not predict well beyond the numbers of the training data
✔✔RMSPE - ✔✔Root Mean Square Prediction Error for model accuracy.
Used in KNN regression.
small RMSPE = good model
large RMSPE = bad model
✔✔Linear regression - ✔✔Creates a straight line of best fit through the training data and
then "look up" the prediction using a line.
single predictor = a line
two predictors = a plane
Good when: there is a linear ish relationship
Good for:
- predicting new variables
- showing the strength of relationships between variables
✔✔Outliers in linear regression - ✔✔As long as there is enough data, one or two
outliers won't affect it a lot
✔✔Clustering - ✔✔A data analysis technique where you separate a dataset into groups
of related data
✔✔Statistical interference - ✔✔The process of using a sample to make a conclusion
about the broader population from which it is taken
✔✔Population - ✔✔The complete collection of individuals we are interested in studying.
ex. undergrad students at UBC
✔✔Population parameter - ✔✔A numerical characteristic of the entire population
ex. the proportion of population that are iPhone users