Last active
August 26, 2022 18:44
-
-
Save JarrydWannenburg/a683d3470251db375fd391d90fcf3aeb to your computer and use it in GitHub Desktop.
Scalable_Pipeline_Article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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