From bb8ee313b6c7bd7eef2804f9714875e6476cbf09 Mon Sep 17 00:00:00 2001 From: Aurelien Geron Date: Thu, 1 Jun 2017 09:53:20 +0200 Subject: [PATCH] Make notebook code match book examples more closely in chapter 2 --- 02_end_to_end_machine_learning_project.ipynb | 25 +++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/02_end_to_end_machine_learning_project.ipynb b/02_end_to_end_machine_learning_project.ipynb index 642bc7406..5ec3d2012 100644 --- a/02_end_to_end_machine_learning_project.ipynb +++ b/02_end_to_end_machine_learning_project.ipynb @@ -3101,16 +3101,12 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": null, "metadata": { - "collapsed": false, - "deletable": true, - "editable": true + "collapsed": true }, "outputs": [], "source": [ - "from sklearn.pipeline import FeatureUnion\n", - "\n", "num_attribs = list(housing_num)\n", "cat_attribs = [\"ocean_proximity\"]\n", "\n", @@ -3124,7 +3120,20 @@ "cat_pipeline = Pipeline([\n", " ('selector', DataFrameSelector(cat_attribs)),\n", " ('label_binarizer', LabelBinarizer()),\n", - " ])\n", + " ])" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false, + "deletable": true, + "editable": true + }, + "outputs": [], + "source": [ + "from sklearn.pipeline import FeatureUnion\n", "\n", "full_pipeline = FeatureUnion(transformer_list=[\n", " (\"num_pipeline\", num_pipeline),\n", @@ -3200,7 +3209,7 @@ "editable": true }, "source": [ - "# Prepare the data for Machine Learning algorithms" + "# Select and train a model " ] }, {