| import streamlit as st |
| import pandas as pd |
| import requests |
|
|
| |
| st.title("SuperKart Retail Store Sales Predictor App") |
|
|
| |
| st.subheader("This tool predicts SuperKart Retail Store Sales based on the product and store details. Enter the required information below.") |
|
|
| st.subheader("Enter the Product and Store details:") |
|
|
| |
| Product_Type = st.selectbox("Product Type", ["Fruits and Vegetables", "Snack Foods", "Frozen Foods", "Dairy","Household","Baking Goods","Canned","Health and Hygiene","Meat","Soft Drinks","Breads","Hard Drinks","Others","Starchy Foods","Breakfast","Seafood"]) |
| Product_Sugar_Content = st.selectbox("Product Sugar Content",["Low Sugar","Regular","No Sugar"]) |
| Store_Type = st.selectbox("Store Type",["Supermarket Type2","Supermarket Type1","Departmental Store","Food Mart"]) |
| Product_Weight = st.number_input("Product Weight (Lbs):",min_value = 0.01, value = 12.60, max_value = 30.00) |
| Product_MRP = st.number_input("Product MRP ($):",min_value = 1.00, value = 150.00, max_value = 300.00) |
| Product_Allocated_Area = st.number_input("Product Allocated Area (%):",min_value = 0.001, value = 0.060, max_value = 0.350) |
|
|
| |
| input_data = pd.DataFrame([{ |
| "Product_Weight" : Product_Weight, |
| "Product_Allocated_Area" : Product_Allocated_Area, |
| "Product_MRP" : Product_MRP, |
| "Product_Sugar_Content" : Product_Sugar_Content, |
| "Product_Type" : Product_Type, |
| "Store_Type" : Store_Type |
| }]) |
|
|
| |
| if st.button("Predict"): |
| |
| |
| response = requests.post("https://AIForecaster-Superkart-Store-Revenue-PredictionBackend.hf.space/v1/superkart", json=input_data.to_dict(orient='records')[0]) |
| if response.status_code == 200: |
| prediction = response.json()['Predicted Store Sales (in Dollars)'] |
| st.success(f"Predicted Store Sales (in dollars): {prediction}") |
| else: |
| st.error("Error making prediction.") |
|
|