The syntax to use a ColumnTransformer
is (alias, transformer, column_names)
. In your definitions of categorical_features
and numerical_features
you are passing data instead of the names of the columns. Try passing categorical_columns
and the definition we original give for numerical_features
to the ColumnTransformer
, i.e.
numerical_features = [
"LotFrontage", "LotArea", "MasVnrArea", "BsmtFinSF1", "BsmtFinSF2",
"BsmtUnfSF", "TotalBsmtSF", "1stFlrSF", "2ndFlrSF", "LowQualFinSF",
"GrLivArea", "BedroomAbvGr", "KitchenAbvGr", "TotRmsAbvGrd", "Fireplaces",
"GarageCars", "GarageArea", "WoodDeckSF", "OpenPorchSF", "EnclosedPorch",
"3SsnPorch", "ScreenPorch", "PoolArea", "MiscVal",
]
For future references, it is a lot easier for us to help users when we can copy-paste your code, which can be formated using markdown.