Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -73,12 +73,12 @@ def predict_rental_price_batch():
|
|
| 73 |
# Read the CSV file into a Pandas DataFrame
|
| 74 |
input_data = pd.read_csv(file)
|
| 75 |
|
| 76 |
-
# Make predictions for all properties in the DataFrame (get
|
| 77 |
predicted_sales = model.predict(input_data).tolist()
|
| 78 |
|
| 79 |
-
# Create a dictionary of predictions with
|
| 80 |
-
|
| 81 |
-
output_dict = dict(zip(
|
| 82 |
|
| 83 |
# Return the predictions dictionary as a JSON response
|
| 84 |
return output_dict
|
|
|
|
| 73 |
# Read the CSV file into a Pandas DataFrame
|
| 74 |
input_data = pd.read_csv(file)
|
| 75 |
|
| 76 |
+
# Make predictions for all properties in the DataFrame (get sales)
|
| 77 |
predicted_sales = model.predict(input_data).tolist()
|
| 78 |
|
| 79 |
+
# Create a dictionary of predictions with product IDs as keys
|
| 80 |
+
product_ids = input_data['Product_Id'].tolist() # Assuming 'product_id' is the product ID column
|
| 81 |
+
output_dict = dict(zip(product_ids, predicted_sales)) # Use actual sales
|
| 82 |
|
| 83 |
# Return the predictions dictionary as a JSON response
|
| 84 |
return output_dict
|