File size: 1,844 Bytes
5120b1d
 
 
 
 
 
 
 
 
 
 
 
 
 
5f7baad
 
5120b1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33dd0db
 
 
 
 
5120b1d
 
 
 
 
 
 
4f87892
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

import streamlit as st
import pandas as pd
import joblib
import numpy as np

# Load the trained model
@st.cache_resource
def load_model():
    return joblib.load("Product_Store_Sales_Total_Prediction_model_v1_0.joblib")

model = load_model()

# Streamlit UI for Price Prediction
st.title("SuperKart Product Store Sales Total Prediction App")
st.write("This tool predict the sales total of a SuperKart store based on product details.")

st.subheader("Enter the product details")

# Collect the products input
store_id = st.text_input("Store_Id")
store_establishment_year = st.text_input("Store_Establishment_Year (in years)")
store_size = st.text_input("Store_Size")
store_location_city_type = st.text_input("Store_Location_City_Type")
store_type = st.text_input("Store_Type")
product_sugar_content = st.text_input("Product_Sugar_Content")
product_type = st.text_input("Product_Type")
product_weight = st.text_input("Product_Weight")
product_allocated_area = st.text_input("Product_Allocated_Area")
product_mrp = st.text_input("Product_MRP")

# Convert user input into a DataFrame
input_data = pd.DataFrame([{
    "Store_Id": store_id,
    "Store_Establishment_Year": store_establishment_year,
    "Store_Size": store_size,
    "Store_Location_City_Type": store_location_city_type,
    "Store_Type": store_type,
    "Product_Sugar_Content": product_sugar_content,
    "Product_Type": product_type,
    "Product_Weight": product_weight,
    "Product_Allocated_Area": product_allocated_area,
    "Product_MRP": product_mrp,
    "Product_Id": "FD6114" # Placeholder for Product_Id as it's not user input in this UI
}])

# Predict button
if st.button("Predict"):
    # Make prediction when the "predict" button is clicked
    prediction = model.predict(input_data)
    st.write(f"Predicted product store sales total (in dollars): {prediction[0]}")