Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -112,7 +112,7 @@ def predict_product_sales_batch():
|
|
| 112 |
file = request.files['file']
|
| 113 |
|
| 114 |
# Read the CSV file into a Pandas DataFrame
|
| 115 |
-
|
| 116 |
|
| 117 |
#Creating df with numeric features.
|
| 118 |
numeric_features = df[['Product_Weight', 'Product_Allocated_Area', 'Product_MRP', 'Store_Age']]
|
|
@@ -152,7 +152,7 @@ def predict_product_sales_batch():
|
|
| 152 |
|
| 153 |
# Make predictions for all properties in the DataFrame (get log_prices)
|
| 154 |
predicted_sales = model.predict(input_df).tolist()
|
| 155 |
-
prod_id_list =
|
| 156 |
|
| 157 |
# Create a dictionary of predictions with property IDs as keys
|
| 158 |
output_dict = dict(zip(prod_id_list, predicted_sales))
|
|
|
|
| 112 |
file = request.files['file']
|
| 113 |
|
| 114 |
# Read the CSV file into a Pandas DataFrame
|
| 115 |
+
df = pd.read_csv(file)
|
| 116 |
|
| 117 |
#Creating df with numeric features.
|
| 118 |
numeric_features = df[['Product_Weight', 'Product_Allocated_Area', 'Product_MRP', 'Store_Age']]
|
|
|
|
| 152 |
|
| 153 |
# Make predictions for all properties in the DataFrame (get log_prices)
|
| 154 |
predicted_sales = model.predict(input_df).tolist()
|
| 155 |
+
prod_id_list = df['Product_Id'].tolist()
|
| 156 |
|
| 157 |
# Create a dictionary of predictions with property IDs as keys
|
| 158 |
output_dict = dict(zip(prod_id_list, predicted_sales))
|