Fah commited on
Commit
2cd9931
1 Parent(s): 06769ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -16,17 +16,17 @@ def predict_cvr(xyz_campaign_id, gender, age, Impressions, Clicks,
16
  pred = cvr_saved.predict(df).tolist()[0] #เมื่่อถูกทำนายแล้ว มันจะส่งกลับคืนค่าเข้าไปใน pred
17
  return 'Conversion Rate : '+str(pred) #function predict_cvr จะส่ง output ออกมาเป็น "Conversion Rate : pred"
18
 
19
- xyz_campaign_id = gr.inputs.Dropdown(['campaign_a', 'campaign_b', 'campaign_c'], label="xyz_campaign_id")
20
- gender = gr.inputs.Dropdown(['M', 'F'], label = "gender")
21
- age = gr.inputs.Dropdown(['30-34', '35-39', '40-44', '45-49'], label = "age")
22
- Impressions = gr.inputs.Slider(minimum=100,maximum=1000000,step=100,label = "Impressions")
23
- Clicks = gr.inputs.Slider(minimum=1,maximum=500,step=1, label = "Clicks")
24
- Total_Conversion = gr.inputs.Slider(minimum=1,maximum=100,step= 1, label = "Total_Conversion")
25
- interest = gr.inputs.Slider(minimum=1,maximum=114,step= 1, label = "interest")
26
 
27
  gr.Interface(predict_cvr, inputs =[xyz_campaign_id, gender, age, Impressions, Clicks,
28
  Total_Conversion, interest],
29
  outputs="label",
30
  title = "Facebook Ads Conversions Prediction Web App",
31
- theme = "dark-peach",
32
  capture_session=True).launch();
 
16
  pred = cvr_saved.predict(df).tolist()[0] #เมื่่อถูกทำนายแล้ว มันจะส่งกลับคืนค่าเข้าไปใน pred
17
  return 'Conversion Rate : '+str(pred) #function predict_cvr จะส่ง output ออกมาเป็น "Conversion Rate : pred"
18
 
19
+ xyz_campaign_id = gr.inputs.Dropdown(['campaign_a', 'campaign_b', 'campaign_c'], label="xyz_campaign_id -> an ID associated with each ad campaign of XYZ company")
20
+ gender = gr.inputs.Dropdown(['M', 'F'], label = "gender -> gender of the person to whom the add is shown")
21
+ age = gr.inputs.Dropdown(['30-34', '35-39', '40-44', '45-49'], label = "age -> age of the person to whom the ad is shown")
22
+ Impressions = gr.inputs.Slider(minimum=100, maximum=3000000, default = 50000, step=100, label = "Impressions -> the number of times the ad was shown")
23
+ Clicks = gr.inputs.Slider(minimum=1, maximum=500, default = 8, step=1, label = "Clicks -> number of clicks on for that ad")
24
+ Total_Conversion = gr.inputs.Slider(minimum= 1, maximum= 60, default = 1, step= 1, label = "Total_Conversion -> the number of people who responded to the product after seeing the ad")
25
+ interest = gr.inputs.Slider(minimum=1, maximum=114, default = 25, step= 1, label = "interest -> a code specifying the category to which the person’s interest belongs (interests are as mentioned in the person’s Facebook public profile)")
26
 
27
  gr.Interface(predict_cvr, inputs =[xyz_campaign_id, gender, age, Impressions, Clicks,
28
  Total_Conversion, interest],
29
  outputs="label",
30
  title = "Facebook Ads Conversions Prediction Web App",
31
+ theme = "peach",
32
  capture_session=True).launch();