Lokiiparihar commited on
Commit
0a9e2b2
·
verified ·
1 Parent(s): c2b76f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -14,7 +14,7 @@ st.title("Customer Churn Prediction App")
14
  st.write("This tool predicts customer churn risk based on their details. Enter the required information below.")
15
 
16
  # Collect user input based on dataset columns
17
- SeniorCitizen = st.selectbox("Is the customer a senior citizen?",[0, 1])
18
  Partner = st.selectbox("Does the customer have a partner?", ["Yes", "No"])
19
  Dependents = st.selectbox("Does the customer have dependents?", ["Yes", "No"])
20
  PhoneService = st.selectbox("Does the customer have phone service?", ["Yes", "No"])
@@ -27,10 +27,10 @@ TotalCharges = st.number_input("Total Charges", min_value=0.0, value=600.0)
27
 
28
  # Convert categorical inputs to match model training
29
  input_data = pd.DataFrame([{
30
- 'SeniorCitizen' : 1,
31
- 'Partner': 1 if Partner == "Yes" else 0,
32
- 'Dependents': 1 if Dependents == "Yes" else 0,
33
- 'PhoneService': 1 if PhoneService == "Yes" else 0,
34
  'InternetService': InternetService,
35
  'Contract': Contract,
36
  'PaymentMethod': PaymentMethod,
 
14
  st.write("This tool predicts customer churn risk based on their details. Enter the required information below.")
15
 
16
  # Collect user input based on dataset columns
17
+ SeniorCitizen = st.selectbox("Is the customer a senior citizen?",["Yes", "No"])
18
  Partner = st.selectbox("Does the customer have a partner?", ["Yes", "No"])
19
  Dependents = st.selectbox("Does the customer have dependents?", ["Yes", "No"])
20
  PhoneService = st.selectbox("Does the customer have phone service?", ["Yes", "No"])
 
27
 
28
  # Convert categorical inputs to match model training
29
  input_data = pd.DataFrame([{
30
+ 'SeniorCitizen': 1 if SeniorCitizen == "Yes" else 0,
31
+ 'Partner': Partner,
32
+ 'Dependents': Dependents,
33
+ 'PhoneService': PhoneService,
34
  'InternetService': InternetService,
35
  'Contract': Contract,
36
  'PaymentMethod': PaymentMethod,