Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 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 |
-
|
| 28 |
else:
|
| 29 |
-
|
| 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
|
| 42 |
predicted_value = model_prediction(model, features)
|
| 43 |
-
if predicted_value
|
| 44 |
-
|
| 45 |
else:
|
| 46 |
-
|
| 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="
|
| 75 |
page_icon=":chart_with_upwards_trend:",
|
| 76 |
)
|
| 77 |
|
| 78 |
-
st.title("Welcome to our
|
| 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")
|