Created
July 16, 2020 19:31
-
-
Save occult/27c8abbbfb1d118021508e612a6c7fe4 to your computer and use it in GitHub Desktop.
Numeric features engineering
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
train_test_features['YearsSinceBuilt'] = train_test_features['YrSold'].astype(int) - train_test_features['YearBuilt'].astype(int) | |
train_test_features['YearsSinceRemod'] = train_test_features['YrSold'].astype(int) - train_test_features['YearRemodAdd'].astype(int) | |
train_test_features['TotalWalledArea'] = train_test_features['TotalBsmtSF'] + train_test_features['GrLivArea'] | |
train_test_features['TotalPorchArea'] = train_test_features['OpenPorchSF'] + train_test_features['3SsnPorch'] + train_test_features['EnclosedPorch'] + train_test_features['ScreenPorch'] + train_test_features['WoodDeckSF'] | |
train_test_features['TotalOccupiedArea'] = train_test_features['TotalWalledArea'] + train_test_features['TotalPorchArea'] | |
train_test_features['OtherRooms'] = train_test_features['TotRmsAbvGrd'] - train_test_features['BedroomAbvGr'] - train_test_features['KitchenAbvGr'] | |
train_test_features['TotalBathrooms'] = train_test_features['FullBath'] + (0.5 * train_test_features['HalfBath']) + train_test_features['BsmtFullBath'] + (0.5 * train_test_features['BsmtHalfBath']) | |
train_test_features['LotDepth'] = train_test_features['LotArea'] / train_test_features['LotFrontage'] | |
train_test_features['YearAvg']= (train_test_features['YearRemodAdd']+train_test_features['YearBuilt'].astype(int))/2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment