{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a9741f07",
   "metadata": {},
   "source": [
    "# Classification\n",
    "\n",
    "This chapter introduces classification as supervised machine learning for category prediction. You will study nearest neighbors, training and testing, feature tables, implementation, and accuracy.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "31a0d815",
   "metadata": {},
   "source": [
    "<h2>Chapter Video</h2>\n",
    "\n",
    "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube-nocookie.com/embed/jmLid2x9eKg\" title=\"Supervised Machine Learning: Crash Course Statistics #36\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen referrerpolicy=\"strict-origin-when-cross-origin\"></iframe>\n",
    "\n",
    "<div class=\"video-credit\">\n",
    "<p><strong>Video credit:</strong> CrashCourse. (2018, October 31). <em>Supervised Machine Learning: Crash Course Statistics #36</em>. YouTube. <a href=\"https://youtube.com/watch?v=jmLid2x9eKg\">Watch on YouTube</a>.</p>\n",
    "<p class=\"video-rights\">This embedded video is provided for educational reference only. All rights are retained by the respective copyright holder.</p>\n",
    "</div>\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bb6a99d7",
   "source": "```{contents}\n:local:\n:depth: 2\n```",
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "id": "d27c21c9",
   "metadata": {},
   "source": [
    "<h2>Learning Objectives</h2>\n",
    "\n",
    "By the end of this chapter, you will be able to:\n",
    "\n",
    "1. Distinguish classification from regression and clustering.\n",
    "2. Use labeled examples to predict categorical outcomes.\n",
    "3. Explain nearest-neighbor classification with distance and similarity.\n",
    "4. Separate training data from testing data when evaluating a classifier.\n",
    "5. Measure classifier accuracy and discuss limits of prediction.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "56dccd84",
   "metadata": {},
   "source": [
    "<h2>Chapter Flow</h2>\n",
    "\n",
    "```{div} chapter-flow\n",
    "{doc}`Classification <1401-classification>`\n",
    "\n",
    "{doc}`Nearest Neighbors <1402-nearest-neighbors>`\n",
    "\n",
    "{doc}`Training, Testing, and Accuracy <1403-training-testing-accuracy>`\n",
    "\n",
    "{doc}`Rows of Tables <1404-rows-of-tables>`\n",
    "\n",
    "{doc}`Implementing the Classifier <1405-implementing-the-classifier>`\n",
    "```\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b9036adf",
   "metadata": {},
   "source": [
    "<h2>Glossary</h2>\n",
    "\n",
    "| # | Term | Explanation |\n",
    "|---:|---|---|\n",
    "| 1 | Classification | Predicting a categorical label for an observation. |\n",
    "| 2 | Classifier | A model or rule that assigns labels. |\n",
    "| 3 | Label | The category being predicted. |\n",
    "| 4 | Feature | An input variable used for prediction. |\n",
    "| 5 | Training data | Labeled data used to build a classifier. |\n",
    "| 6 | Test data | Labeled data reserved for evaluation. |\n",
    "| 7 | Nearest neighbor | A classifier that predicts from the most similar example. |\n",
    "| 8 | Distance | A numeric measure of dissimilarity between observations. |\n",
    "| 9 | Similarity | How alike two observations are according to selected features. |\n",
    "| 10 | Feature space | The coordinate system formed by model features. |\n",
    "| 11 | Decision boundary | The region where predicted labels change. |\n",
    "| 12 | Accuracy | The fraction of test cases classified correctly. |\n",
    "| 13 | Error rate | The fraction of test cases classified incorrectly. |\n",
    "| 14 | Confusion matrix | A table comparing predicted labels with true labels. |\n",
    "| 15 | False positive | A case incorrectly predicted as belonging to a class. |\n",
    "| 16 | False negative | A case incorrectly predicted as not belonging to a class. |\n",
    "| 17 | Overfitting | When a classifier matches training data too closely. |\n",
    "| 18 | Generalization | Performance on new data beyond the training sample. |\n",
    "| 19 | Supervised learning | Learning from examples with known labels. |\n",
    "| 20 | Validation | Checking model choices using held-out data. |\n",
    "| 21 | Row of a table | One observation or case in a dataset. |\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4cd5a86b",
   "metadata": {},
   "source": [
    "<h2><a href=\"overview.html\" target=\"_blank\" rel=\"noopener noreferrer\">Chapter Overview Slides</a></h2>\n"
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 5
}
