Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -16,35 +16,34 @@ st.write(
|
|
| 16 |
st.subheader("Online Prediction (Single Product-Store Entry)")
|
| 17 |
|
| 18 |
# Collect user input for product & store features
|
| 19 |
-
product_weight = st.number_input("Product Weight (
|
| 20 |
-
product_sugar_content = st.selectbox("Sugar Content", ["
|
| 21 |
-
product_allocated_area = st.number_input("Allocated
|
| 22 |
-
product_type = st.selectbox(
|
| 23 |
-
"
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
)
|
| 28 |
-
product_mrp = st.number_input("Maximum Retail Price (MRP)", min_value=1.0, value=50.0)
|
| 29 |
|
| 30 |
-
store_id = st.
|
| 31 |
-
|
| 32 |
-
store_size = st.selectbox("Store Size", ["
|
| 33 |
-
store_location_city_type = st.selectbox("Store
|
| 34 |
-
store_type = st.selectbox("Store Type", ["
|
| 35 |
|
| 36 |
-
#
|
| 37 |
input_data = pd.DataFrame([{
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
}])
|
| 49 |
|
| 50 |
# Make prediction when "Forecast Sales" is clicked
|
|
|
|
| 16 |
st.subheader("Online Prediction (Single Product-Store Entry)")
|
| 17 |
|
| 18 |
# Collect user input for product & store features
|
| 19 |
+
product_weight = st.number_input("Product Weight (kg)", min_value=4.0, max_value=22.0, value=12.65, step=0.1)
|
| 20 |
+
product_sugar_content = st.selectbox("Sugar Content", ["Low Sugar", "Regular", "No Sugar", "Non-edible"])
|
| 21 |
+
product_allocated_area = st.number_input("Allocated Area (ratio)", min_value=0.004, max_value=0.298, value=0.068, step=0.001)
|
| 22 |
+
product_type = st.selectbox("Product Type", [
|
| 23 |
+
"Fruits and Vegetables", "Snack Foods", "Dairy", "Canned", "Soft Drinks",
|
| 24 |
+
"Health and Hygiene", "Baking Goods", "Bread", "Breakfast", "Frozen Foods",
|
| 25 |
+
"Household", "Seafood", "Starchy Foods", "Meat", "Hard Drinks", "Others"
|
| 26 |
+
])
|
| 27 |
+
product_mrp = st.number_input("Product MRP", min_value=31.0, max_value=266.0, value=147.0, step=1.0)
|
|
|
|
| 28 |
|
| 29 |
+
store_id = st.selectbox("Store ID", ["OUT001","OUT002","OUT003","OUT004"])
|
| 30 |
+
store_establishment_year = st.number_input("Store Establishment Year", min_value=1987, max_value=2025, value=2002, step=1)
|
| 31 |
+
store_size = st.selectbox("Store Size", ["High", "Medium", "Low"])
|
| 32 |
+
store_location_city_type = st.selectbox("Store City Type", ["Tier 1", "Tier 2", "Tier 3"])
|
| 33 |
+
store_type = st.selectbox("Store Type", ["Supermarket Type1", "Supermarket Type2", "Supermarket Type3", "Food Mart"])
|
| 34 |
|
| 35 |
+
# Input DataFrame with EXACT column names as training
|
| 36 |
input_data = pd.DataFrame([{
|
| 37 |
+
"Product_Weight": product_weight,
|
| 38 |
+
"Product_Sugar_Content": product_sugar_content,
|
| 39 |
+
"Product_Allocated_Area": product_allocated_area,
|
| 40 |
+
"Product_Type": product_type,
|
| 41 |
+
"Product_MRP": product_mrp,
|
| 42 |
+
"Store_Id": "store_id",
|
| 43 |
+
"Store_Establishment_Year": store_establishment_year,
|
| 44 |
+
"Store_Size": store_size,
|
| 45 |
+
"Store_Location_City_Type": store_location_city_type,
|
| 46 |
+
"Store_Type": store_type
|
| 47 |
}])
|
| 48 |
|
| 49 |
# Make prediction when "Forecast Sales" is clicked
|