Skip to content

Commit

Permalink
Make notebook code match book examples more closely in chapter 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ageron committed Jun 1, 2017
1 parent b072bcb commit bb8ee31
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions 02_end_to_end_machine_learning_project.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -3200,7 +3209,7 @@
"editable": true
},
"source": [
"# Prepare the data for Machine Learning algorithms"
"# Select and train a model "
]
},
{
Expand Down

0 comments on commit bb8ee31

Please sign in to comment.