Skip to content

Instantly share code, notes, and snippets.

@JonathanLoscalzo
Created February 28, 2020 13:24
Show Gist options
  • Select an option

  • Save JonathanLoscalzo/0877e9ed40a7e36de62e7072f09cdf9e to your computer and use it in GitHub Desktop.

Select an option

Save JonathanLoscalzo/0877e9ed40a7e36de62e7072f09cdf9e to your computer and use it in GitHub Desktop.
Feature Union example
def preprocess_pipeline():
return FeatureUnion(
transformer_list = [
('date_features', Pipeline([
('selector', get_date_data),
('transform', transform_date_data)
])),
('numeric_features', Pipeline([
('selector', get_numeric_data),
('imputer', SimpleImputer()),
])),
('text_features', Pipeline([
('selector', get_text_data),
('vectorizer', OrdinalEncoder())
]))
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment