Cacti0102/ProductSalesPrediction
0
1import streamlit as st2import pandas as pd3import joblib4import numpy as np5 6model = joblib.load("gradient_boosting_model_pipeline.joblib")7 8st.title("SuperKart") #Define the title of the app.9 10# Input fields for product and store data11st.subheader("Enter the product and store details:")12 13Product_Weight = st.number_input("Product Weight", min_value=0.0, value=12.66)14Product_Sugar_Content = st.selectbox("Product Sugar Content", ["Low Sugar", "Regular", "No Sugar"])15Product_Allocated_Area = st.number_input("Product Allocated Area", min_value=0.0, value=0.068)16Product_MRP = st.number_input("Product MRP", min_value=0.0, value=147.03)17Store_Size = st.selectbox("Store Size", ["Medium", "High", "Small"])18Store_Location_City_Type = st.selectbox("Store Location City Type", ["Tier 2", "Tier 1", "Tier 3"])19Store_Type = st.selectbox("Store Type", ["Supermarket Type2", "Departmental Store", "Supermarket Type1", "Food Mart"])20Product_Id_char = st.selectbox("Product ID Character", ["FD", "NC", "DR"])21Store_Age_Years = st.number_input("Store Age (Years)", min_value=0, value=20)22Product_Type_Category = st.selectbox("Product Type Category", ["Perishables", "Non Perishables"])23 24product_data = pd.DataFrame([{25 "Product_Weight": Product_Weight,26 "Product_Sugar_Content": Product_Sugar_Content,27 "Product_Allocated_Area": Product_Allocated_Area,28 "Product_MRP": Product_MRP,29 "Store_Size": Store_Size,30 "Store_Location_City_Type": Store_Location_City_Type,31 "Store_Type": Store_Type,32 "Product_Id_char": Product_Id_char,33 "Store_Age_Years": Store_Age_Years,34 "Product_Type_Category": Product_Type_Category35}])36 37if st.button("Predict"):38 prediction = model.predict(product_data)39 st.write(f"The predicted sales of the product is {(prediction)}.")40 