Spaces:
Runtime error
Runtime error
Kwasiasomani
commited on
Commit
•
6cea37c
1
Parent(s):
25a2395
Update app.py
Browse files
app.py
CHANGED
@@ -127,12 +127,18 @@ if menu == 'Prediction target':
|
|
127 |
# defining categories and numeric columns
|
128 |
|
129 |
col = ['city']
|
130 |
-
columns = list(input_data.columns)
|
131 |
-
|
|
|
|
|
|
|
132 |
|
133 |
# we dropped the categorical encoder column before we concat
|
134 |
train_enc = input_data.drop(['city'],axis = 1)
|
135 |
-
input_d = pd.concat([train_enc, encoded_cat], axis=1)
|
|
|
|
|
|
|
136 |
|
137 |
# convert input_data to a numpy array before flattening to convert it back to a 2D array
|
138 |
input_df= input_d.to_numpy()
|
|
|
127 |
# defining categories and numeric columns
|
128 |
|
129 |
col = ['city']
|
130 |
+
#columns = list(input_data.columns)
|
131 |
+
input_encoded_df = pd.DataFrame(encoder.transform(input_data).toarray(),
|
132 |
+
columns=encoder.get_feature_names_out(col))
|
133 |
+
|
134 |
+
#encoded_cat = Encoder.transform(input_data[col])
|
135 |
|
136 |
# we dropped the categorical encoder column before we concat
|
137 |
train_enc = input_data.drop(['city'],axis = 1)
|
138 |
+
#input_d = pd.concat([train_enc, encoded_cat], axis=1)
|
139 |
+
input_d = pd.concat([train_enc, input_encoded_df], axis=1)
|
140 |
+
|
141 |
+
|
142 |
|
143 |
# convert input_data to a numpy array before flattening to convert it back to a 2D array
|
144 |
input_df= input_d.to_numpy()
|