Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -65,11 +65,12 @@ def predict_sales_forecast_batch():
|
|
| 65 |
|
| 66 |
# Read the CSV file into a Pandas DataFrame
|
| 67 |
input_data = pd.read_csv(file)
|
|
|
|
| 68 |
|
| 69 |
# Make predictions for all properties in the DataFrame (get log_prices)
|
| 70 |
-
predicted_sales = model.predict(input_data
|
| 71 |
-
|
| 72 |
|
|
|
|
| 73 |
# Create a dictionary of predictions with property IDs as keys
|
| 74 |
product_ids = input_data['Product_Id'].tolist() # Assuming 'Product_Id' is the property ID column
|
| 75 |
output_dict = dict(zip(product_ids, predicted_sales)) # Use actual prices
|
|
@@ -79,4 +80,4 @@ def predict_sales_forecast_batch():
|
|
| 79 |
|
| 80 |
# Run the Flask app in debug mode
|
| 81 |
if __name__ == '__main__':
|
| 82 |
-
|
|
|
|
| 65 |
|
| 66 |
# Read the CSV file into a Pandas DataFrame
|
| 67 |
input_data = pd.read_csv(file)
|
| 68 |
+
print(batch_data.loc[0])
|
| 69 |
|
| 70 |
# Make predictions for all properties in the DataFrame (get log_prices)
|
| 71 |
+
predicted_sales = model.predict(input_data).tolist()
|
|
|
|
| 72 |
|
| 73 |
+
print(predicted_sales)
|
| 74 |
# Create a dictionary of predictions with property IDs as keys
|
| 75 |
product_ids = input_data['Product_Id'].tolist() # Assuming 'Product_Id' is the property ID column
|
| 76 |
output_dict = dict(zip(product_ids, predicted_sales)) # Use actual prices
|
|
|
|
| 80 |
|
| 81 |
# Run the Flask app in debug mode
|
| 82 |
if __name__ == '__main__':
|
| 83 |
+
superkart_product_sales_prediction_api.run(debug=True)
|