title: Generating pipeline using sklearn in python
body: <p>I am trying out code from Aurelien Geron's book 'Hands-on machine learning'. The part on preparing data for ML algos has the following code on transformation pipelines:</p>
  <pre><code>from sklearn.pipeline import FeatureUnion 
  num_attribs = list(housing_num)
  cat_attribs = [&quot;ocean_proximity&quot;]
  
  num_pipeline = pipeline([
  ('selector', DataFrameSelector(num_attribs)), ('imputer', Imputer(strategy=&quot;median&quot;)), ('attribs_adder', CombinedAttributesAdder()), ('std_scaler', StandardScaler()),
  ])
  
  cat_pipeline = pipeline([
  ('selector', DataFrameSelector(cat_attribs)), ('label_binarizer', LabelBinarizer()),
  ])
  
  full_pipeline = FeatureUnion(transformer_list=[ (&quot;num_pipeline&quot;, num_pipeline), (&quot;cat_pipeline&quot;, cat_pipeline),
  ])
  </code></pre>
  <p>As I run this, I get an error 'name 'pipeline' is not defined'. How do I overcome this?</p>