nurindahpratiwi commited on
Commit
14ef77d
·
1 Parent(s): 17f565c
Files changed (1) hide show
  1. app.py +21 -18
app.py CHANGED
@@ -11,7 +11,7 @@ from transformers import pipeline
11
  import datetime
12
  from huggingface_hub import hf_hub_download
13
 
14
- REPO_ID = "albiecofie/predict-customer-churn"
15
 
16
  num_imputer = joblib.load(
17
  hf_hub_download(repo_id=REPO_ID, filename="numerical_imputer.joblib")
@@ -53,25 +53,28 @@ st.subheader("Enter the details to predict sales")
53
  input_data = {}
54
  col1,col2 = st.columns(2)
55
  with col1:
56
- input_data['store_nbr'] = st.slider("store_nbr",0,54)
57
- input_data['products'] = st.selectbox("products", ['AUTOMOTIVE', 'CLEANING', 'BEAUTY', 'FOODS', 'STATIONERY',
58
- 'CELEBRATION', 'GROCERY', 'HARDWARE', 'HOME', 'LADIESWEAR',
59
- 'LAWN AND GARDEN', 'CLOTHING', 'LIQUOR,WINE,BEER', 'PET SUPPLIES'])
60
- input_data['onpromotion'] =st.number_input("onpromotion",step=1)
61
- input_data['state'] = st.selectbox("state", ['Pichincha', 'Cotopaxi', 'Chimborazo', 'Imbabura',
62
- 'Santo Domingo de los Tsachilas', 'Bolivar', 'Pastaza',
63
- 'Tungurahua', 'Guayas', 'Santa Elena', 'Los Rios', 'Azuay', 'Loja',
64
- 'El Oro', 'Esmeraldas', 'Manabi'])
65
- input_data['store_type'] = st.selectbox("store_type",['D', 'C', 'B', 'E', 'A'])
66
- input_data['cluster'] = st.number_input("cluster",step=1)
67
 
68
  with col2:
69
- input_data['dcoilwtico'] = st.number_input("dcoilwtico",step=1)
70
- input_data['year'] = st.number_input("year",step=1)
71
- input_data['month'] = st.slider("month",1,12)
72
- input_data['day'] = st.slider("day",1,31)
73
- input_data['dayofweek'] = st.number_input("dayofweek,0=Sun and 6=Sat",step=1)
74
- input_data['end_month'] = st.selectbox("end_month",['True','False'])
 
 
 
 
 
75
 
76
 
77
  # Define CSS style for the download button
 
11
  import datetime
12
  from huggingface_hub import hf_hub_download
13
 
14
+ REPO_ID = "AlbieCofie/predict-customer-churn"
15
 
16
  num_imputer = joblib.load(
17
  hf_hub_download(repo_id=REPO_ID, filename="numerical_imputer.joblib")
 
53
  input_data = {}
54
  col1,col2 = st.columns(2)
55
  with col1:
56
+ input_data["gender"] = st.radio('Select your gender', ('male', 'female'))
57
+ input_data["SeniorCitizen"] = st.radio("Are you a Seniorcitizen; No=0 and Yes=1", ('0', '1'))
58
+ input_data["Partner"] = st.radio('Do you have Partner', ('Yes', 'No'))
59
+ input_data["Dependents"] = st.selectbox('Do you have any Dependents?', ('No', 'Yes'))
60
+ input_data["tenure"] = st.number_input('Lenght of tenure (no. of months with Telco)', min_value=0, max_value=90, value=1, step=1)
61
+ input_data["PhoneService"] = st.radio('Do you have PhoneService? ', ('No', 'Yes'))
62
+ input_data["MultipleLines"] = st.radio('Do you have MultipleLines', ('No', 'Yes'))
63
+ input_data["InternetService"] = st.radio('Do you have InternetService', ('DSL', 'Fiber optic', 'No'))
64
+ input_data["OnlineSecurity"] = st.radio('Do you have OnlineSecurity?', ('No', 'Yes'))
 
 
65
 
66
  with col2:
67
+ input_data["OnlineBackup"] = st.radio('Do you have OnlineBackup?', ('No', 'Yes'))
68
+ input_data["DeviceProtection"] = st.radio('Do you have DeviceProtection?', ('No', 'Yes'))
69
+ input_data["TechSupport"] = st.radio('Do you have TechSupport?', ('No', 'Yes'))
70
+ input_data["StreamingTV"] = st.radio('Do you have StreamingTV?', ('No', 'Yes'))
71
+ input_data["StreamingMovies"] = st.radio('Do you have StreamingMovies?', ('No', 'Yes'))
72
+ input_data["Contract"] = st.selectbox('which Contract do you use?', ('Month-to-month', 'One year', 'Two year'))
73
+ input_data["PaperlessBilling"] = st.radio('Do you prefer PaperlessBilling?', ('Yes', 'No'))
74
+ input_data["PaymentMethod"] = st.selectbox('Which PaymentMethod do you prefer?', ('Electronic check', 'Mailed check', 'Bank transfer (automatic)',
75
+ 'Credit card (automatic)'))
76
+ input_data["MonthlyCharges"] = st.number_input("Enter monthly charges (the range should between 0-120)")
77
+ input_data["TotalCharges"] = st.number_input("Enter total charges (the range should between 0-10.000)")
78
 
79
 
80
  # Define CSS style for the download button