{
"metadata": {
"name": "",
"signature": "sha256:f47cdb88b392068632307f333229ec83e8305108b83c91e0efc2ff0062f3b3c2"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Introduction"
]
},
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Sections"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- [Cross Validation](Cross-validation)\n",
"- [Bootstrapping](#Bootstrapping)\n",
"- [Jackknifing](#Jackknifing)\n",
"- [A K-fold Cross Validation Example](#A-K-fold-Cross-Validation-Example)\n",
" - [Reading in the Wine dataset](#Reading-in-the-Wine-dataset)\n",
" - [Resampling into Test and Training datasets](#Resampling-into-Test-and-Training-datasets)\n",
" - [Cross Validation](#Cross-Validation)\n",
" - [Training the classifier](#Training-the-classifier)\n",
" - [Standardization](#Standardization)\n",
" - [Dimensionality Reduction: Linear Discriminant Analysis (LDA)](Dimensionality-Reduction:-Linear-Discriminant-Analysis-(LDA))\n",
" - [Naive Bayes Classifier](#Naive-Bayes-Classifier)\n",
" - [Evaluation](#Evaluation)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
"
]
},
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Cross Validation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[[back to top](#Sections)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
"
]
},
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Bootstrapping"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[[back to top](#Sections)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
"
]
},
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Jackknifing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[[back to top](#Sections)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
"
]
},
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"A K-fold Cross Validation Example"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[[back to top](#Sections)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Reading in the Wine dataset"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[[back to top](#Sections)]"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import pandas as pd\n",
"\n",
"df = pd.io.parsers.read_csv(\n",
" filepath_or_buffer='https://raw.githubusercontent.com/rasbt/pattern_classification/master/data/wine_data.csv', \n",
" header=None, \n",
" sep=',', \n",
" )\n",
"df.tail()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"
\n", " | 0 | \n", "1 | \n", "2 | \n", "3 | \n", "4 | \n", "5 | \n", "6 | \n", "7 | \n", "8 | \n", "9 | \n", "10 | \n", "11 | \n", "12 | \n", "13 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
173 | \n", "3 | \n", "13.71 | \n", "5.65 | \n", "2.45 | \n", "20.5 | \n", "95 | \n", "1.68 | \n", "0.61 | \n", "0.52 | \n", "1.06 | \n", "7.7 | \n", "0.64 | \n", "1.74 | \n", "740 | \n", "
174 | \n", "3 | \n", "13.40 | \n", "3.91 | \n", "2.48 | \n", "23.0 | \n", "102 | \n", "1.80 | \n", "0.75 | \n", "0.43 | \n", "1.41 | \n", "7.3 | \n", "0.70 | \n", "1.56 | \n", "750 | \n", "
175 | \n", "3 | \n", "13.27 | \n", "4.28 | \n", "2.26 | \n", "20.0 | \n", "120 | \n", "1.59 | \n", "0.69 | \n", "0.43 | \n", "1.35 | \n", "10.2 | \n", "0.59 | \n", "1.56 | \n", "835 | \n", "
176 | \n", "3 | \n", "13.17 | \n", "2.59 | \n", "2.37 | \n", "20.0 | \n", "120 | \n", "1.65 | \n", "0.68 | \n", "0.53 | \n", "1.46 | \n", "9.3 | \n", "0.60 | \n", "1.62 | \n", "840 | \n", "
177 | \n", "3 | \n", "14.13 | \n", "4.10 | \n", "2.74 | \n", "24.5 | \n", "96 | \n", "2.05 | \n", "0.76 | \n", "0.56 | \n", "1.35 | \n", "9.2 | \n", "0.61 | \n", "1.60 | \n", "560 | \n", "