Update app.py
Browse files
app.py
CHANGED
|
@@ -204,14 +204,15 @@ if submitted:
|
|
| 204 |
|
| 205 |
|
| 206 |
# Getting date Features
|
|
|
|
| 207 |
processed_data= getDateFeatures(df, 'date')
|
| 208 |
processed_data= processed_data.drop(columns=['date'])
|
| 209 |
|
| 210 |
# Encoding Categorical Variables
|
| 211 |
-
|
| 212 |
cols = ['family', 'city', 'state', 'store_type', 'locale', 'locale_name', 'day_type']
|
| 213 |
for col in cols:
|
| 214 |
-
processed_data[
|
| 215 |
|
| 216 |
# Making Predictions
|
| 217 |
def predict(X, model= Loaded_object['model']):
|
|
|
|
| 204 |
|
| 205 |
|
| 206 |
# Getting date Features
|
| 207 |
+
# Getting date Features
|
| 208 |
processed_data= getDateFeatures(df, 'date')
|
| 209 |
processed_data= processed_data.drop(columns=['date'])
|
| 210 |
|
| 211 |
# Encoding Categorical Variables
|
| 212 |
+
encoder = preprocessing.LabelEncoder()
|
| 213 |
cols = ['family', 'city', 'state', 'store_type', 'locale', 'locale_name', 'day_type']
|
| 214 |
for col in cols:
|
| 215 |
+
processed_data[col] = encoder.fit_transform(processed_data[col])
|
| 216 |
|
| 217 |
# Making Predictions
|
| 218 |
def predict(X, model= Loaded_object['model']):
|