s25059 commited on
Commit
7c8bd85
·
verified ·
1 Parent(s): 22d1dea

Update app

Browse files
Files changed (1) hide show
  1. app/app.py +7 -3
app/app.py CHANGED
@@ -8,14 +8,18 @@ APP_DIR = os.path.dirname(os.path.abspath(__file__))
8
  ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
9
  METRICS_DIR = os.path.join(ROOT, "metrics")
10
  MODEL_PATH = os.path.join(ROOT, "src", "model.pkl")
11
- DATA_PATH = os.path.join(ROOT, "data", "ad_click_dataset.csv")
12
 
13
  model = joblib.load(MODEL_PATH)
14
  with open(os.path.join(METRICS_DIR, 'metrics.json')) as f:
15
  metrics = json.load(f)
16
 
17
- df = pd.read_csv(DATA_PATH)
18
- cat_options = {col: df[col].dropna().unique().tolist() for col in df.columns if col not in ['id', 'full_name', 'click', 'age']}
 
 
 
 
 
19
 
20
  st.title("Ad Click Predictor")
21
  st.markdown(
 
8
  ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
9
  METRICS_DIR = os.path.join(ROOT, "metrics")
10
  MODEL_PATH = os.path.join(ROOT, "src", "model.pkl")
 
11
 
12
  model = joblib.load(MODEL_PATH)
13
  with open(os.path.join(METRICS_DIR, 'metrics.json')) as f:
14
  metrics = json.load(f)
15
 
16
+ cat_options = {
17
+ "gender": ["Male", "Female", "Other"],
18
+ "device_type": ["Mobile", "Desktop", "Tablet"],
19
+ "ad_position": ["Top", "Side", "Bottom"],
20
+ "browsing_history": ["Sports", "News", "Shopping", "Other"],
21
+ "time_of_day": ["Morning", "Afternoon", "Evening", "Night"]
22
+ }
23
 
24
  st.title("Ad Click Predictor")
25
  st.markdown(