LalithaShiva commited on
Commit
67cbc8c
·
verified ·
1 Parent(s): 0a666a4

Upload 3 files

Browse files
app.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import streamlit as st
3
+ import pandas as pd
4
+ import joblib
5
+ import numpy as np
6
+
7
+ # Load the trained model
8
+ @st.cache_resource
9
+ def load_model():
10
+ return joblib.load("superkart_price_prediction_model_v1_0.joblib")
11
+
12
+ model = load_model()
13
+
14
+ # Streamlit UI for Price Prediction
15
+ st.title("SuperKart Rental Price Prediction App")
16
+ st.write("This tool predicts the price of an Superkart total sales based on the property type.")
17
+
18
+ st.subheader("Enter the listing details:")
19
+
20
+ # Collect user input
21
+ product_Weight=st.number_input("Product_Weight", min_value=1, value=30.00)
22
+ product_Sugar_Content=st.selectbox("Product Sugar Content", ["Low Sugar", "No Sugar", "Regular"])
23
+ product_Allocated_Area=st.number_input("Product Allocate Area", min_value=0.001, value=0.09)
24
+ product_Type=st.selectbox("Product Type", ["meat", "snack foods", "hard drinks", "dairy", "canned", "soft drinks", "health and hygiene", "baking goods", "bread", "breakfast", "frozen foods", "fruits and vegetables", "household", "seafood", "starchy foods", "others"])
25
+ product_MRP=st.number_input("Product MRP", min_value=1, value=30.00)
26
+ store_Id=st.selectbox("Store ID", ["OUT001", "OUT002", "OUT003", "OUT004"])
27
+ store_Establishment_Year=st.number_input("Store Establishment year", min_value=1987, value=2009)
28
+ store_Size=st.selectbox("Store Size", ["High", "Medium", "Small"])
29
+ store_Location_City_Type=st.selectbox("Store location City", ["Tier1", "Tier2", "Tier3"])
30
+ store_Type=st.selectbox("Store Type", ["Departmental Store", "Supermarket Type 1", "Supermarket Type 2", "Food Mart"])
31
+
32
+
33
+ # Convert user input into a DataFrame
34
+ input_data = pd.DataFrame([{
35
+ 'product_Weight': product_Weight,
36
+ 'product_Sugar_Content': product_Sugar_Content,
37
+ 'product_Allocated_Area': product_Allocated_Area,
38
+ 'product_Type': product_Type,
39
+ 'product_MRP': product_MRP,
40
+ 'store_Id': store_Id,
41
+ 'store_Establishment_Year': store_Establishment_Year,
42
+ 'store_Size': store_Size,
43
+ 'store_Location_City_Type': store_Location_City_Type,
44
+ 'store_Type': store_Type
45
+ }])
46
+
47
+ # Predict button
48
+ if st.button("Predict"):
49
+ prediction = model.predict(input_data)
50
+ st.write(f"The predicted price of the superkart sales is ${np.exp(prediction)[0]:.2f}.")
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ pandas==2.2.2
2
+ numpy==2.0.2
3
+ scikit-learn==1.6.1
4
+ xgboost==2.1.4
5
+ joblib==1.4.2
6
+ streamlit==1.43.2
superkart_price_prediction_model_v1_0.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8fbbd8e8467f0175d853283854df1651cf335ccd46f4e907c0e0b314e3fa198e
3
+ size 21