Skip to content

Instantly share code, notes, and snippets.

@JarrydWannenburg
Last active August 26, 2022 18:44
Show Gist options
  • Save JarrydWannenburg/a683d3470251db375fd391d90fcf3aeb to your computer and use it in GitHub Desktop.
Save JarrydWannenburg/a683d3470251db375fd391d90fcf3aeb to your computer and use it in GitHub Desktop.
Scalable_Pipeline_Article
class CatFeatureEngineerTransformer(BaseEstimator, TransformerMixin):
def __init__(self, home_dest = True):
self.home_dest = home_dest
def fit(self, X, y=None):
return self
def transform(self, X, y=None):
if self.home_dest:
X['HomeDest'] = X.HomePlanet + ':' + X.Destination
X.drop(columns=['HomePlanet', 'Destination'], inplace=True)
return X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment