Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -76,14 +76,11 @@ def predict_store_sales_batch():
|
|
| 76 |
input_data = pd.read_csv(file)
|
| 77 |
|
| 78 |
# Make predictions for all properties in the DataFrame (get store_saless)
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
# Calculate actual prices
|
| 82 |
-
predicted_saless = [round(float((store_sales)), 2) for store_sales in predicted_store_saless]
|
| 83 |
|
| 84 |
# Create a dictionary of predictions with property IDs as keys
|
| 85 |
-
property_ids = input_data['
|
| 86 |
-
output_dict = dict(zip(property_ids,
|
| 87 |
|
| 88 |
# Return the predictions dictionary as a JSON response
|
| 89 |
return output_dict
|
|
|
|
| 76 |
input_data = pd.read_csv(file)
|
| 77 |
|
| 78 |
# Make predictions for all properties in the DataFrame (get store_saless)
|
| 79 |
+
predicted_store_sales = model.predict(input_data.drop("Product_Id",axis=1)).tolist()
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
# Create a dictionary of predictions with property IDs as keys
|
| 82 |
+
property_ids = input_data['Product_Id'].tolist() # Assuming 'id' is the property ID column
|
| 83 |
+
output_dict = dict(zip(property_ids, predicted_sales)) # Use actual prices
|
| 84 |
|
| 85 |
# Return the predictions dictionary as a JSON response
|
| 86 |
return output_dict
|