Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -45,12 +45,12 @@ def predict_product_sales():
|
|
| 45 |
# Convert the extracted data into a Pandas DataFrame
|
| 46 |
input_data = pd.DataFrame([sample])
|
| 47 |
|
| 48 |
-
# Make prediction (get
|
| 49 |
-
|
| 50 |
-
print(f"Predicted
|
| 51 |
|
| 52 |
# Calculate actual price
|
| 53 |
-
predicted_price = np.exp(
|
| 54 |
|
| 55 |
# Convert predicted_price to Python float
|
| 56 |
predicted_price = round(float(predicted_price), 2)
|
|
@@ -77,10 +77,10 @@ def predict_product_sale_price_batch():
|
|
| 77 |
input_data = pd.read_csv(file)
|
| 78 |
|
| 79 |
# Make predictions for all product sale in the stores in the DataFrame (get log_prices)
|
| 80 |
-
|
| 81 |
|
| 82 |
# Calculate actual prices
|
| 83 |
-
predicted_prices = [round(float(np.exp(
|
| 84 |
|
| 85 |
# Create a dictionary of predictions with product IDs as keys
|
| 86 |
product_ids = input_data['id'].tolist() # Assuming 'id' is the product ID column
|
|
|
|
| 45 |
# Convert the extracted data into a Pandas DataFrame
|
| 46 |
input_data = pd.DataFrame([sample])
|
| 47 |
|
| 48 |
+
# Make prediction (get Product_Store_Sales_Total)
|
| 49 |
+
predicted_Product_Store_Sales_Total = model.predict(input_data)[0]
|
| 50 |
+
print(f"Predicted Product_Store_Sales_Total: {predicted_Product_Store_Sales_Total}")
|
| 51 |
|
| 52 |
# Calculate actual price
|
| 53 |
+
predicted_price = np.exp(predicted_Product_Store_Sales_Total)
|
| 54 |
|
| 55 |
# Convert predicted_price to Python float
|
| 56 |
predicted_price = round(float(predicted_price), 2)
|
|
|
|
| 77 |
input_data = pd.read_csv(file)
|
| 78 |
|
| 79 |
# Make predictions for all product sale in the stores in the DataFrame (get log_prices)
|
| 80 |
+
predicted_Product_Store_Sales_Total = model.predict(input_data).tolist()
|
| 81 |
|
| 82 |
# Calculate actual prices
|
| 83 |
+
predicted_prices = [round(float(np.exp(total_sale_price)), 2) for total_sale_price in predicted_Product_Store_Sales_Total]
|
| 84 |
|
| 85 |
# Create a dictionary of predictions with product IDs as keys
|
| 86 |
product_ids = input_data['id'].tolist() # Assuming 'id' is the product ID column
|