{ "cells": [ { "cell_type": "markdown", "id": "d1a5669b", "metadata": {}, "source": [ "# Class 17: Evaluating Classification and Midsemester Feedback\n", "\n", "1. share your favorite rainy day activity (or just say hi) in the zoom chat for attendance\n", "1. log onto prismia\n", "\n", "\n", "## Naive Bayes Review\n", "\n", "\n", "Main assumptions:\n", "- classification assumes that features will separate the gorups\n", "- NB: conditionally independent" ] }, { "cell_type": "code", "execution_count": 1, "id": "5bf5536f", "metadata": {}, "outputs": [], "source": [ "# %load http://drsmb.co/310\n", "import pandas as pd\n", "import seaborn as sns\n", "import numpy as np\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.naive_bayes import GaussianNB" ] }, { "cell_type": "code", "execution_count": 2, "id": "39a6df82", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | sepal_length | \n", "sepal_width | \n", "petal_length | \n", "petal_width | \n", "species | \n", "
---|---|---|---|---|---|
0 | \n", "5.1 | \n", "3.5 | \n", "1.4 | \n", "0.2 | \n", "setosa | \n", "
1 | \n", "4.9 | \n", "3.0 | \n", "1.4 | \n", "0.2 | \n", "setosa | \n", "
2 | \n", "4.7 | \n", "3.2 | \n", "1.3 | \n", "0.2 | \n", "setosa | \n", "
3 | \n", "4.6 | \n", "3.1 | \n", "1.5 | \n", "0.2 | \n", "setosa | \n", "
4 | \n", "5.0 | \n", "3.6 | \n", "1.4 | \n", "0.2 | \n", "setosa | \n", "