def drop_variable(self, df):
# if HousePrices._is_one_hot_encoder:
# Drop all categorical feature helping columns ('Num')
# Todo: is it defined when importing data set? _feature_names_num
# for feature_name in HousePrices._feature_names_num:
# df = df.drop([feature_name], axis=1)
# is_with_feature_agglomeration = 0
# if is_with_feature_agglomeration:
# print(df.shape)
# df = HousePrices.feature_agglomeration(df)
# print(df.shape)
# df = df.drop(['Fireplaces'], axis=1)
df = df.drop(['Id'], axis=1)
if not any(tuple(df.columns == 'SalePrice')):
# All feature var names occuring in test data is assigned the public varaible df_test_all_feature_var_names.
self.df_test_all_feature_var_names = df.columns
return df
评论列表
文章目录