
Explore Tidymodels classification in the third installment, transitioning from regression, outlining basics, algorithms, and the course plan.
Explore Tidymodels classification, contrast it with regression, and outline the course structure—from introduction to advanced topics and clustering in supervised learning, and coverage of unsupervised learning.
Discover how this tidymodels part 3 course blends theory and practical coding with lectures and coding sessions, plus assignments, exercises, and complete materials in R and PDFs.
Engage with one exercise per section in tidymodels classification, test your coding skills with new tidymodels tricks, and choose solo practice or guided walkthroughs and assignments with eda scripts.
Learn to access and run the tidymodels classification scripts via the course GitHub repository, using RStudio or other tools, with session info and package versions.
Explore classification basics, contrast with regression, and build logistic regression models using base R and tidymodels, including odds, log odds, and maximum likelihood estimation with a toy example.
Master classification in tidymodels part 3 by contrasting regression, mastering binary and multiclass tasks, and interpreting probabilities with decision thresholds.
Explore logistic regression for classification by predicting exam pass probabilities from study hours, using a sigmoid link, and comparing with linear regression while introducing odds and log odds.
Explore probabilities, odds, and log odds within the logistic regression framework. Use a binary win-lose example to show empirical p, 1-p, and how odds relate to outcomes.
Explore how probabilities translate to odds, defined as p divided by 1 minus p. See the example seven of ten wins, and learn that log odds underpin logistic regression.
Explore the relationship between probability, odds, and log odds by defining logit p as the natural log of p/(1−p) and derive the inverse logit.
Model whether a student passes an exam from hours studied using logistic regression; map probabilities to log odds with the sigmoid function and use maximum likelihood estimation.
Learn how maximum likelihood estimation estimates logistic regression parameters for binary outcomes, using a Bernoulli distribution and a sigmoid link, instead of ordinary least squares in classification.
Explore how logistic regression uses the Bernoulli distribution and maximum likelihood estimation to fit beta0 and beta1, define the likelihood and log-likelihood, and derive the sigmoid probability.
Estimate the logistic sigmoid model by computing estimated probabilities and their log likelihoods, then maximize the log likelihood to obtain beta zero and beta one.
Estimate logistic regression parameters with R, interpret them in log odds, and convert to an odds ratio showing how each hour of studying multiplies the odds of passing.
Explore logistic regression in R by estimating parameters with glm from a binomial model, using hours studied to predict pass or fail among 250 college students.
Load the exam results data, fit a logistic regression model, and generate probability and binary predictions, then visualize the sigmoid function with study hours and pass/fail outcomes.
Visualize the fitted logistic regression with a sigmoid curve, generate x values, extract coefficients, plot data, and review the model summary for Tidymodels integration.
Examine logistic regression results in tidymodels, interpreting coefficients, log odds, p-values, deviance and AIC, and note convergence iterations before transitioning to classification metrics for ML.
Develop a logistic regression model using mtcars to predict transmission type from mpg, visualize distributions and the sigmoid curve, and interpret model coefficients and predictions.
Explore a logistic regression solution for binary classification using tidymodels, fitting a binomial glm on mpg to predict automatic versus manual transmission, with a sigmoid curve and coefficient interpretation.
Build a logistic regression model with tidymodels workflow to predict pass or fail from hours of studying, using an 80/20 train-test split and accuracy as the main metric.
Explore logistic regression with tidymodels, including data prep, recipe and workflow setup, a train-test split, predictions, and accuracy evaluation.
Explore multivariate logistic regression with multiple predictors and penalized logistic regression, including elastic net, ridge, and lasso, using tidymodels and the Pima diabetes dataset.
Explore multivariate logistic regression on the Pima diabetes data, then apply elastic-net penalized logistic regression, tune hyperparameters, and compare models via cross-validated accuracy and predictions.
Build an elastic-net penalized logistic regression; set up five-fold cross-validation tuning penalty and mixture. Then finalize and fit best model, validating with cross-validated accuracy and collecting predictions for analysis.
Compare multivariate logistic regression and elastic net penalization on test data to generate probabilities and 0.5 threshold predictions, then assess accuracy. Visualize the four confusion categories for diabetes.
Explore classification and logistic regression, from probabilities, odds, and log odds to maximum likelihood estimation, then build a multivariate penalized logistic regression model in R with Tidymodels.
Explore classification modeling on the biopsy data from the mass package, predicting malignant versus benign breast tumors with logistic regression, data wrangling, imputation, EDA, and evaluation on an 80/20 split.
Walks through an assignment using a multivariate logistic regression on mass biopsy data, covering data cleaning, preprocessing, imputation, 80/20 split, and evaluation with accuracy and the confusion matrix.
Explore classification metrics beyond accuracy, learning how to choose the right metric and practice calculating precision, recall, specificity, sensitivity, and F1 with threshold optimization and ROC AUC.
Transition from regression to classification metrics using binary targets, replacing RMSE and R squared with classification measures. Interpret confusion matrices, true and false positives, and precision, recall, and F1 score.
Explore how accuracy measures the proportion of correct predictions from the confusion matrix and its limits with imbalanced data; consider balanced accuracy as an alternative and using Tidymodels functions.
Learn precision and recall beyond accuracy using confusion matrices; precision is the fraction of true positives among predicted positives, while recall (sensitivity) is the fraction of actual positives identified.
Explore classification metrics by building a dummy data generator and calculating a confusion matrix, accuracy, precision, and recall using yardstick in tidymodels.
Compare manual calculations of accuracy, precision, and recall with yardstick results using a dummy data set. Confirm that the manual approach matches yardstick and emphasize adopting yardstick for future analyses.
Load test data and predictions, implement a custom classification metrics function to compute the confusion matrix and accuracy, precision, recall, compare with yardstick, and plot results.
Follow along as the walkthrough computes classification metrics from test prediction data using a logistic regression model, builds a confusion matrix, and compares accuracy, precision, and recall with yardstick.
Explore specificity, sensitivity, recall, and precision, and how changing prediction thresholds affects them. Learn to balance precision and recall with the F1 score for imbalanced data using tidymodels.
Learn to calculate specificity and F1 score in R by deriving true negatives, false positives, precision, and recall, with and without yardstick, and understand the F1 measure and beta parameter.
Tune probability thresholds to balance precision, recall, and F1, and observe the effects on the confusion matrix, accuracy, sensitivity, and specificity, especially with imbalanced data.
Understand ROC curves and AUC, exploring how threshold shifts affect sensitivity and specificity, and compare logistic, random, and perfect classifiers. Learn to compute ROC and AUC with tidymodels yardstick.
Build a roc curve in R from scratch, compute true and false positive rates across thresholds, and visualize with ggplot, while linking to auc and yardstick comparisons.
Finish this roc analysis with yardstick, computing true positive rate, false positive rate, sensitivity, and specificity to obtain the area under the curve.
We shift from a single regression metric to multiple classification metrics, covering accuracy, precision, recall, F1, and ROC curves with AUC. We discuss thresholds and imbalanced data trade-offs.
Compute and compare classification metrics across three datasets using test data with a custom classification_metrics function. Explore roc curve construction, thresholding, and auc estimation with yardsticks to assess model performance.
Explore an assignment walkthrough that builds a classification workflow, computes confusion matrix metrics, and compares diabetes, cancer, and student data using roc curves and auc.
Explore imbalanced data in binary classification with balanced accuracy and precision-recall metrics, tune probability thresholds, compare ROC and PR curves, and apply downsampling, upsampling, and additional resampling techniques.
Explore how imbalanced data in binary classification skews accuracy, and learn to use precision, recall, F1, ROC, and threshold tuning to improve minority-class performance.
Explore how imbalanced data affects metrics like accuracy, sensitivity, specificity, and balanced accuracy, and tune thresholds for minority-class detection.
Explore advanced classification metrics for imbalanced data, including F1 and generalized F-measure with beta to weight precision and recall. Learn about J index and MCC for threshold optimization with tidymodels.
Explore advanced metrics for imbalanced data in classification, including balanced accuracy, f1, f0.5, f2, youden index, and ncc, with threshold tuning for binary predictions.
Explore probability threshold tuning for imbalanced data, showing how changing the cutoff affects metrics and model selection, with sequential tuning vs joint tuning, stratified cross-validation, and metric-driven optimization.
Explore the probability threshold tuning for classification in tidymodels part 3. Load data, perform stratified ten-fold cross-validation, train a logistic regression model, and identify the optimal balanced accuracy across thresholds.
Tune probability thresholds to maximize mean balanced accuracy across ten assessment folds, identify the optimal threshold (about 0.113) with balanced accuracy around 0.745, and visualize the results.
Extend ROC analysis with the precision–recall curve to visualize precision–recall trade-offs across thresholds for imbalanced data, focusing on the positive class and PR AUC as a summary.
Learn to create and visualize a precision–recall curve with yardstick and ggplot2, extract data from test screening data, and estimate the area under the curve.
Explore probability threshold tuning across three medical screening data sets using logistic regression with tidymodels. Visualize precision-recall curves and compare metrics like accuracy, F1, Gini, and MCC.
Learn threshold tuning for classification with tidymodels, training logistic regression across three scenarios using cross-validated predictions, and evaluating balance accuracy, F1, J index, MCC, and precision-recall curves.
Balance imbalanced data with simple resampling in tidymodels, using downsampling, upsampling, and smote to adjust training-set ratios. Understand how these methods differ from cross-validation and their trade-offs.
Apply stratified cross-validation to medical screening data and compare no sampling, downsampling, and upsampling, adjusting the minority target ratio using themis for class imbalance.
Compare three resampling techniques for imbalanced data. Visualize balanced accuracy, precision, recall, PR AUC, and J index across no sampling, downsampling, and upsampling.
Explore advanced resampling techniques for class imbalance focusing on SMOTE, which creates synthetic minority samples via kNN interpolation and balances classes within tidymodels.
Explore advanced resampling for class imbalance by adding smote, comparing with upsampling and downsampling, and evaluating balanced accuracy, precision, recall, and auc to select the best model.
Apply best practices for imbalanced classification using diverse metrics and resampling, tune thresholds, evaluate on original data distribution, and translate results for business needs.
Explore imbalanced data effects on metrics, including balanced accuracy and MCC. Prepare with threshold tuning, ROC and precision-recall curves; implement downsampling, upsampling, SMOTE in tidymodels for the assignment.
Develop imbalanced telco churn models with logistic regression using downsampling, upsampling, and SMOTE, plus threshold tuning on train-test data, evaluated with F1 scores.
Walks through a classification assignment with tidymodels, covering EDA, recipe-based data prep, stratified train-test splits, and logistic regression models using downsampling, upsampling, and SMOTE, with F1 and PR AUC tuning.
Explore two classification algorithms, k nearest neighbors and Naive Bayes, and learn to implement them in tidymodels for classification tasks, including text data and spam filtering examples.
Explore k nearest neighbor classification in tidymodels: select k, compute distances, vote to predict binary classes, and scale data with one-hot encoding and cross validation.
Explore knn classification using tidymodels in R, with cancer biopsy data, data preprocessing, 80/20 split, cross-validation, and hyperparameter tuning of k, evaluating with roc auc.
Choose the best k in a k nearest neighbors classifier by maximizing AUC across assessment faults, then retrain on the full training data and evaluate predictions on the test set.
Build a k nearest neighbor classifier on the diabetes data with tenfold stratified cross-validation, imputation, one-hot encoding, and normalization, then tune k and evaluate metrics.
Apply a k-nearest neighbors classifier to diabetes data, recoding the response, preprocessing with median imputation, one-hot encoding, and numeric normalization, and tune k using cross-validated AUC to select 35 neighbors.
Update prior beliefs with new evidence using Bayes' theorem, deriving posterior probabilities through conditional probability. Introduce the naive Bayes classifier and a disease-test example to illustrate priors, likelihoods, and evidence.
learn how the naive Bayes classifier uses prior and likelihood to compute posterior probabilities under conditional independence, enabling fast, scalable text and spam filtering.
Explore a spam filtering example using Naive Bayes with discrete features, where emails are represented by a tiny word vocabulary and presence-absence features, driven by priors, likelihoods, and Laplace smoothing.
Explore naive Bayes with continuous features using Gaussian assumptions, estimate means and standard deviations for glucose and weight, and classify patients as sick or healthy with Tidymodels.
This lecture explains building a naive bayes classifier in tidymodels, comparing klar and a fast c-based engine, and tuning the laplace alpha and kernel parameters in a cross-validated workflow.
Tune a naive Bayes classifier on the Pima diabetes data with tidymodels, recoding the target to 0/1, imputing median, dropping zero-variance features, and evaluating via 10-fold cross-validation.
Learn tidymodels' naive bayes classifier workflow: tune for AUC, select and train the best model, and evaluate test AUC, with upcoming text-based tricks.
Learn how Tidymodels uses Text Recipes to convert text into numeric features for spam classification, through tokenization, normalization, stopword removal, stemming, and TF-IDF or bag-of-words representations.
Refresh the classification of k-nearest neighbors, introduce Naive Bayes with discrete and continuous features, and demonstrate building classifiers using Tidymodels and text recipes for a spam-filter assignment.
Build a text message spam classifier using sms data with three algorithms: logistic regression, kNN, and naive bayes, and two features: word counts and tf-idf, with hyperparameter tuning.
Join the assignment walkthrough for tidymodels classification on spam detection, including EDA, text cleaning, tf-idf feature engineering, and comparison of logistic regression, kNN, and Naive Bayes with cross-validated AUC.
Wrap up tidymodels part 3 by summarizing classification concepts and previewing part 4 with more industry-standard algorithms, multi-class challenges, and unsupervised learning in the R world.
You’ve mastered regression modeling and explored advanced algorithms; now it’s time to step into the world of classification.
This course is designed for learners who want to build models that predict categories, not numbers, and who wish to understand the statistical and machine learning foundations behind them.
What You’ll Learn
In this course, you’ll move from probability intuition to full-scale classification workflows using tidymodels, R’s modern ecosystem for machine learning:
Understand what classification is and how it differs from regression
Learn the logic of logistic regression and its link to probabilities, odds, and log-odds
Fit and interpret logistic regression models using maximum likelihood estimation
Evaluate models with accuracy, precision, recall, specificity, and F1 score
Visualize model performance through ROC and AUC curves
Adjust probability thresholds and see their effect on predictions
Handle imbalanced data using balanced accuracy, threshold tuning, and advanced metrics
Apply resampling techniques such as upsampling, downsampling, and SMOTE
Build and tune K-nearest neighbors (KNN) classifiers
Explore Naive Bayes as a probabilistic classifier for both numeric and text data
Preprocess text using textrecipes and create a simple spam-filtering model
Compare multiple classification models within the same tidymodels workflow
Why Take This Course?
Classification problems are everywhere — from medical diagnostics and fraud detection to email filtering and customer segmentation.
This course helps you understand how these models make decisions and how to evaluate them responsibly.
You’ll gain not only the technical skills to build classification models but also the intuition to select the right metric and interpret model behavior — all while keeping your work tidy, reproducible, and explainable.
What You’ll Get
Clear, structured explanations of classification theory and practice
Step-by-step modeling workflows in R and tidymodels
Real-world examples and visual explanations of metrics
Exercises and assignments with full solutions
All code, datasets, and outputs provided
Lifetime access and updates