knn k nearest neighbors, k library(class) knn(training data, test data, labels), extra args: k = 2. prob = TRUE enables probability of each guess. Primitive bayes nrows(df), count rows subset(df, conditions/ col > 0 etc.), nrows this subset then do divisions Naive bayes model <- naive_bayes(y ~ x1 + x2 + … , data = df) y as explained by x1, x2 etc. predict(model , test_df) + args type = “prob” show posterior probability (instead of priori overall prob) Laplace correction: add 1 to prevent the 0% probability affects all estimation Logistic Regression model <- glm(y ~ x1 + x2 …, data = df, family = “binomial”) predict(model, test_df, type = “response”) ROC curve to measure how well the model performs, AUC area under curve value from 0 – 1, 1 is best. library(pROC) ROC <- roc(actual var, predicted var) plot(ROC), auc(ROC) Decision Tree library(rpart) model <- rpart(y ~ x1 + x2 + …, data = df, method = “class”, control = rpart.control(cp = 0)) predict(m...