bhumitps commited on
Commit
8999842
·
verified ·
1 Parent(s): 031a724

Upload ./app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
2
  import requests
3
  import pandas as pd
4
  import json
 
5
 
6
  st.title("SuperKart Sales Forecasting")
7
 
@@ -35,6 +36,12 @@ input_data = {
35
  'Store_Type': store_type
36
  }
37
 
 
 
 
 
 
 
38
  # Button to trigger prediction
39
  if st.button("Predict Sales"):
40
  # Hugging Face proxy URL for Flask backend
 
2
  import requests
3
  import pandas as pd
4
  import json
5
+ from datetime import datetime
6
 
7
  st.title("SuperKart Sales Forecasting")
8
 
 
36
  'Store_Type': store_type
37
  }
38
 
39
+ # Add feature engineering for Product_Category and Store_Age
40
+ current_year = datetime.now().year
41
+ input_data['Store_Age'] = current_year - input_data['Store_Establishment_Year']
42
+ input_data['Product_Category'] = input_data['Product_Id'][:2]
43
+
44
+
45
  # Button to trigger prediction
46
  if st.button("Predict Sales"):
47
  # Hugging Face proxy URL for Flask backend