Q6 "FitFailedWarning" message

Can somebody help me understanding the following error message?

My code for dividing the ames housing dataframe into numerical and categorical features looks like this

The code for preprocessing and the final accuracy evaluation looks like this.


So far via google I was not able to understand the basic concept of the problem. Thanks for your help!

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.