Spaces:
Runtime error
Runtime error
Upload 3 files
Browse files- app.py +21 -0
- model.pkl +3 -0
- requirements.txt +3 -0
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pickle
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
# Load model
|
| 6 |
+
model = pickle.load(open("model.pkl", "rb"))
|
| 7 |
+
|
| 8 |
+
st.set_page_config(page_title="SuperKart Sales Predictor")
|
| 9 |
+
st.title("🛒 SuperKart Sales Forecast")
|
| 10 |
+
|
| 11 |
+
st.markdown("Predict sales total based on key product features.")
|
| 12 |
+
|
| 13 |
+
# Input sliders
|
| 14 |
+
product_weight = st.slider("Product Weight", 4.0, 22.0, step=0.1)
|
| 15 |
+
allocated_area = st.slider("Allocated Area Ratio", 0.01, 0.3, step=0.01)
|
| 16 |
+
product_mrp = st.slider("Product MRP", 31.0, 266.0, step=1.0)
|
| 17 |
+
|
| 18 |
+
if st.button("Predict Sales"):
|
| 19 |
+
features = np.array([[product_weight, allocated_area, product_mrp]])
|
| 20 |
+
prediction = model.predict(features)
|
| 21 |
+
st.success(f"📈 Predicted Sales Total: {prediction[0]:.2f}")
|
model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6893819a0954bd023654c065a5ea3839c9fc22c5f669b66ba946ba3b0d9c243f
|
| 3 |
+
size 101946
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
scikit-learn
|
| 3 |
+
numpy
|