hidevscommunity commited on
Commit
7537b32
·
verified ·
1 Parent(s): c0b5132

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -18,19 +18,18 @@ def app_design():
18
  st.image(image, use_column_width=True)
19
 
20
  st.subheader("Enter the following values:")
21
-
22
- Daily_Time_Spent_on_Site = st.number_input("Daily Time Spent On Site")
23
  Age = st.number_input("Age")
24
  Daily_Internet_Usage = st.number_input("Daily Internet Usage")
25
- Gender = st.selectbox("Gender",('Male','Female'))
26
  if Gender == 'Male':
27
- Gender = 0
28
  else:
29
- Gender = 1
30
  Area_income = st.number_input("Area Income")
31
-
32
-
33
 
 
34
  # Create a feature list from the user inputs
35
  features = [[Daily_Time_Spent_on_Site,Age,Daily_Internet_Usage,Gender,Area_income]]
36
 
@@ -38,12 +37,12 @@ def app_design():
38
  model = load_model()
39
 
40
  # Make a prediction when the user clicks the "Predict" button
41
- if st.button('Predict Rate'):
42
  predicted_value = model_prediction(model, features)
43
- if predicted_value == '0':
44
- st.success("Clicked on Ad: NO")
45
  else:
46
- st.success("Clicked on Ad: YES")
47
 
48
 
49
  def about_hidevs():
@@ -71,11 +70,11 @@ def main():
71
 
72
  # Set the app title and add your website name and logo
73
  st.set_page_config(
74
- page_title="Clicked Through Rate Prediction",
75
  page_icon=":chart_with_upwards_trend:",
76
  )
77
 
78
- st.title("Welcome to our Clicked Through Rate Prediction App!")
79
 
80
  app_design()
81
  st.header("About HiDevs Community")
 
18
  st.image(image, use_column_width=True)
19
 
20
  st.subheader("Enter the following values:")
21
+
22
+ Daily_Time_Spent_on_Site = st.number_input("Daily Time Spent on Site")
23
  Age = st.number_input("Age")
24
  Daily_Internet_Usage = st.number_input("Daily Internet Usage")
25
+ Gender = st.selectbox("Gender",('Male','Female'))
26
  if Gender == 'Male':
27
+ Gender = 1
28
  else:
29
+ Gender = 0
30
  Area_income = st.number_input("Area Income")
 
 
31
 
32
+
33
  # Create a feature list from the user inputs
34
  features = [[Daily_Time_Spent_on_Site,Age,Daily_Internet_Usage,Gender,Area_income]]
35
 
 
37
  model = load_model()
38
 
39
  # Make a prediction when the user clicks the "Predict" button
40
+ if st.button('Predict Ads'):
41
  predicted_value = model_prediction(model, features)
42
+ if predicted_value=='1':
43
+ st.success('The Person will buy the product')
44
  else:
45
+ st.success('The Person will not buy the product')
46
 
47
 
48
  def about_hidevs():
 
70
 
71
  # Set the app title and add your website name and logo
72
  st.set_page_config(
73
+ page_title="Click Through Rate Prediction",
74
  page_icon=":chart_with_upwards_trend:",
75
  )
76
 
77
+ st.title("Welcome to our Click Through Rate Prediction App!")
78
 
79
  app_design()
80
  st.header("About HiDevs Community")