Week 6: Classification Error, Evaluation, and Trees
Many classifiers first estimate a probability and then compare it with a cutoff to make a class decision. This week connects probability estimation to classification error, uses logistic regression to study confusion matrices and ROC curves, and introduces trees as flexible prediction rules.
Guiding question: How do we make and evaluate class decisions, and how can a tree learn a flexible prediction rule?
Learning goals
By the end of this week, you should be able to:
- distinguish a true class probability, an estimated probability, and a class decision;
- derive the Bayes classifier and Bayes error for binary classification;
- connect probability losses, bias, and variance to classification error;
- calculate sensitivity and specificity from a confusion matrix and explain how they change with the cutoff;
- construct an ROC curve from logistic probabilities and interpret its AUC; and
- explain tree splits, leaf predictions, and the role of pruning.
Lecture notes
Classification: Probabilities, Decisions, and Learning Error
Bayes decisions and error, Brier and log loss, KNN probability bias and variance, and unequal error costs.
Evaluating Classification Models
Logistic probabilities, confusion matrices, sensitivity and specificity, changing the cutoff, and ROC curves and AUC.
Classification and Regression Trees
Regression RSS, classification Gini, greedy splitting, leaf predictions, and cost-complexity pruning.
Homework 06
Homework 06 contains three required questions: Question 1 compares logistic regression and KNN using test ROC curves and AUC; Question 2 compares training and test ROC curves for different KNN neighborhoods; and Question 3 is a peer evaluation of Homework 5.
Use either R or Python for the computational questions. All homework assignments are evaluated as Complete or Incomplete. Attempt each computational question before consulting the solutions. Complete Question 3, part 2, yourself without AI assistance.
R and Python solutions, including ROC plots and AUC results, are available for Questions 1 and 2. No solution is provided for the peer evaluation in Question 3. The combined ZIP includes the editable homework and solution files and the data needed to run the solutions.
Place homework-06.pdf or homework-06.html in the homework/week-06/ folder of your stat432-fall2026 GitHub repository by Sunday, October 4, 2026, at 11:59 p.m. Central Time. The report must be either a PDF or a self-contained HTML file and must not exceed 10 pages. The final file version shown on GitHub is treated as the submitted version, and its GitHub timestamp determines whether it is on time.
Discussion Session on Tuesday, October 6, 2026
Submit discussion/week-06-question.md by Sunday, October 4, 2026, at 11:59 p.m. Central Time. This required weekly discussion question counts toward the Weekly GitHub Discussion Questions component, worth 10% of the course grade.
The final version shown on GitHub is the submitted version. If its GitHub timestamp is after the deadline, the submission receives 0 points. No late-submission exceptions are allowed.
For the required format and GitHub submission steps, see Discussion Questions: Procedures and Rules.
Quiz 2 takes place before the Week 6 discussion session on Tuesday, October 6, 2026. The quiz covers Weeks 3 through 5. See Quizzes for the quiz format. After the quiz, open Popping when the instructor asks you to join the discussion.
The Week 6 discussion is included in Quiz 3 on Tuesday, October 27, 2026, which covers the Week 6 through Week 8 discussions.
See the Discussion tab for login information. Tell the instructor during class if you cannot sign in.
Discussion Question Topics
The following topics are suggestions. Your question is not limited to this list, but it should relate to the Week 6 material or your peer review of Homework 5.
Peer review of Homework 5. Mistakes or items for improvement you identified while reviewing other students’ Homework 5 reports, including code, reasoning, interpretation, or plots.
Probability estimates and class decisions. Estimated probabilities, decision cutoffs, and resulting class labels are distinct parts of classification.
Bayes error, bias, and variance. Unavoidable outcome variation and uncertainty in estimated probabilities contribute different sources of error.
Training and test ROC curves. Model complexity, sample size, and generalization are central to comparing these curves.
Choosing a cutoff. Sensitivity, specificity, and unequal error costs describe the trade-offs in a classification decision.
Comparing ROC curves and AUC. Ranking performance and decisions at a chosen cutoff provide different views of a classifier.
Tree splits and pruning. Splitting rules, tree size, and pruning connect model flexibility with prediction.
Ask one focused question that calls for an explanation, a comparison, a short derivation, a counterexample, or a small computation. Do not submit a request for code alone or repeat a homework calculation without asking about the statistical reasoning or the specific difficulty you identified.