{
"metadata": {
"name": "",
"signature": "sha256:2a5a0eade9d92d1e9f450ec71f1ad8b87d45a87ce0571e182afd2fdf502ce7a7"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[Sebastian Raschka](http://sebastianraschka.com) \n",
"
\n",
"[Link to](https://github.com/rasbt/pattern_classification) the GitHub repository [pattern_classification](https://github.com/rasbt/pattern_classification)\n",
"
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%load_ext watermark"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%watermark -a 'Sebastian Raschka' -d -u"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Sebastian Raschka Last updated: 12/07/2014 \n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[More information](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/ipython_magic/watermark.ipynb) about the `watermark` magic command extension."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n", " | Class label | \n", "Alcohol | \n", "Malic acid | \n", "
---|---|---|---|
0 | \n", "1 | \n", "14.23 | \n", "1.71 | \n", "
1 | \n", "1 | \n", "13.20 | \n", "1.78 | \n", "
2 | \n", "1 | \n", "13.16 | \n", "2.36 | \n", "
3 | \n", "1 | \n", "14.37 | \n", "1.95 | \n", "
4 | \n", "1 | \n", "13.24 | \n", "2.59 | \n", "
\n", "std_scale = preprocessing.StandardScaler().fit(X_train)\n", "X_train = std_scale.transform(X_train)\n", "X_test = std_scale.transform(X_test)\n", "\n", "\n", "Below, we will perform the calculations using \"pure\" Python code, and an more convenient NumPy solution, which is especially useful if we attempt to transform a whole matrix." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "