adityasharma0511 commited on
Commit
3c8eada
·
verified ·
1 Parent(s): a5e75b7

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -6
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
- predicted_store_saless = model.predict(input_data).tolist()
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['id'].tolist() # Assuming 'id' is the property ID column
86
- output_dict = dict(zip(property_ids, predicted_saless)) # Use actual prices
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