{
"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",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%load_ext watermark"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Sebastian Raschka \n",
"Last updated: 07/30/2015 \n",
"\n",
"CPython 3.4.3\n",
"IPython 3.2.1\n",
"\n",
"scikit-learn 0.16.1\n",
"numpy 1.9.2\n",
"matplotlib 1.4.3\n"
]
}
],
"source": [
"%watermark -a 'Sebastian Raschka' -d -u -v -p scikit-learn,numpy,matplotlib"
]
},
{
"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": [ "