akarora93 commited on
Commit
e9d0c4f
·
verified ·
1 Parent(s): 06803ba

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -56,14 +56,14 @@ def predict_sales_forecast_batch():
56
  # Read the CSV file into a Pandas DataFrame
57
  input_data = pd.read_csv(file)
58
 
59
- # Make predictions for all properties in the DataFrame (get log_prices)
60
- predicted_log_prices = model.predict(input_data).tolist()
61
 
62
  # Calculate actual prices
63
- predicted_sales = [round(float(np.exp(log_price)), 2) for log_price in predicted_log_prices]
64
 
65
- # Create a dictionary of predictions with property IDs as keys
66
- product_ids = input_data['Product_ID'].tolist() # Assuming 'id' is the property ID column
67
  output_dict = dict(zip(product_ids, predicted_sales)) # Use actual prices
68
 
69
  # Return the predictions dictionary as a JSON response
 
56
  # Read the CSV file into a Pandas DataFrame
57
  input_data = pd.read_csv(file)
58
 
59
+ # Make predictions for all products in the DataFrame (get log_prices)
60
+ predicted_sales = model.predict(input_data).tolist()
61
 
62
  # Calculate actual prices
63
+ predicted_sales = [round(float(Product_Store_Sales_Total, 2)) for Product_Store_Sales_Total in predicted_sales]
64
 
65
+ # Create a dictionary of predictions with Product IDs as keys
66
+ product_ids = input_data['Product_ID'].tolist() # Assuming 'id' is the Product ID column
67
  output_dict = dict(zip(product_ids, predicted_sales)) # Use actual prices
68
 
69
  # Return the predictions dictionary as a JSON response