Prashantbhat1607 commited on
Commit
3a6433e
·
verified ·
1 Parent(s): 542670c

Upload folder using huggingface_hub

Browse files
Superkart_prediction_model_v1_0.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb4e0820ccebeb7409dfd3701eac8201c539eece7dc98e5b2c1a01a690311bb7
3
+ size 189205
app.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_prediction_model_v1_0.joblib")
11
+
12
+ model = load_model()
13
+
14
+ # Streamlit UI for Price Prediction
15
+ st.title("Superkart Revenue Prediction App")
16
+ st.write("This tool predicts the Revenue of superkart based on the product details.")
17
+
18
+ st.subheader("Enter the product details:")
19
+
20
+ # Collect user input
21
+ Product_Type = st.selectbox("Product Type",["Baking Goods", "Breads", "Breakfast","Canned","Dairy","Frozen Foods","Fruits and Vegetables","Hard Drinks","Health and Hygiene","Household","Meat","Seafood","Snack Foods","Soft Drinks","Starchy Foods","Others"])
22
+ Product_MRP = st.number_input("MRP", min_value=0, max_value=100)
23
+ Product_Weight = st.number_input("Bathrooms", min_value=0, step=1, max_value=100)
24
+ Product_Sugar_Content = st.selectbox("Product_Sugar_Content", ["Low Sugar", "Regular", "No sugar"])
25
+ Store_Size = st.selectbox("Store_Size", ["Small", "Medium","High"])
26
+ Store_Location_City = st.selectbox("Store_Location_City?", ["Tier1", "Tier2","Tier3"])
27
+ Store_Type = st.selectbox("Store_Type", ["Departmental Store","Food Mart","Supermarket Type 1",'Supermarket Type 2'])
28
+ Product_Allocated_Area = st.number_input("Product_Allocated_Area", min_value=0.0, max_value=100.0, step=1.0, value=1.0)
29
+ Store_Establishment_Year = st.number_input("Store_Establishment_Year", min_value=1900, step=1, max_value=2025)
30
+
31
+
32
+ # Convert user input into a DataFrame
33
+ input_data = pd.DataFrame([{
34
+ "Product_Type": Product_Type,
35
+ "Product_MRP": Product_MRP,
36
+ "Product_Weight": Product_Weight,
37
+ "Product_Sugar_Content": Product_Sugar_Content,
38
+ "Store_Size": Store_Size,
39
+ "Store_Location_City": Store_Location_City,
40
+ "Store_Type": Store_Type,
41
+ "Product_Allocated_Area": Product_Allocated_Area,
42
+ "Store_Establishment_Year": Store_Establishment_Year
43
+ }])
44
+
45
+ # Predict button
46
+ if st.button("Predict"):
47
+ prediction = model.predict(input_data)
48
+ st.write(f"The Predicted revenue of store is ${np.exp(prediction)[0]:.2f}.")
requirements.txt CHANGED
@@ -1,3 +1,6 @@
1
- altair
2
- pandas
3
- streamlit
 
 
 
 
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