Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -62,32 +62,44 @@ st.markdown("""
|
|
| 62 |
# ---------------------------------------------------------
|
| 63 |
# PERSONAL INFORMATION
|
| 64 |
# ---------------------------------------------------------
|
| 65 |
-
with st.expander("👤 1. Personal Information", expanded=True):
|
| 66 |
-
st.markdown('<div class="card">', unsafe_allow_html=True)
|
|
|
|
| 67 |
|
| 68 |
-
col1, col2 = st.columns(
|
| 69 |
with col1:
|
| 70 |
Age = st.number_input("Age", 18, 90, 30)
|
| 71 |
Gender = st.selectbox("Gender", ["Male", "Female"])
|
| 72 |
-
|
| 73 |
-
Passport = st.selectbox("Has Passport?", [0, 1])
|
| 74 |
|
| 75 |
with col2:
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
Occupation = st.selectbox("Occupation", ["Salaried", "Self Employed", "Entrepreneur"])
|
| 79 |
-
|
|
|
|
| 80 |
|
| 81 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 82 |
|
|
|
|
| 83 |
CityTier = {"Tier 1": 1, "Tier 2": 2, "Tier 3": 3}[CityTier_label]
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
# ---------------------------------------------------------
|
| 87 |
# TRAVEL INFORMATION
|
| 88 |
# ---------------------------------------------------------
|
| 89 |
with st.expander("✈️ 2. Travel Information"):
|
| 90 |
-
st.markdown('<div class="card">', unsafe_allow_html=True)
|
|
|
|
| 91 |
|
| 92 |
col1, col2 = st.columns(2)
|
| 93 |
with col1:
|
|
@@ -105,49 +117,57 @@ with st.expander("✈️ 2. Travel Information"):
|
|
| 105 |
# INTERACTION INFORMATION
|
| 106 |
# ---------------------------------------------------------
|
| 107 |
with st.expander("🗣️ 3. Interaction Details"):
|
| 108 |
-
st.markdown('<div class="card">', unsafe_allow_html=True)
|
|
|
|
| 109 |
|
| 110 |
col1, col2 = st.columns(2)
|
| 111 |
|
| 112 |
with col1:
|
| 113 |
-
|
| 114 |
-
NumberOfFollowups = st.number_input("Number of Follow-ups", 0, 20, 1)
|
| 115 |
-
|
| 116 |
-
with col2:
|
| 117 |
-
PitchSatisfactionScore = st.selectbox("Pitch Satisfaction Score", [1, 2, 3, 4, 5])
|
| 118 |
ProductPitched = st.selectbox("Product Pitched",
|
| 119 |
["Basic", "Standard", "Deluxe", "Luxury"])
|
| 120 |
|
| 121 |
-
TypeofContact = st.selectbox("Type of Contact", ["Company Invited", "Self Inquiry"])
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
# ---------------------------------------------------------
|
| 127 |
# Predict Button
|
| 128 |
# ---------------------------------------------------------
|
| 129 |
if st.button("🔮 Predict"):
|
| 130 |
-
input_data = {
|
| 131 |
-
"Age": Age,
|
| 132 |
-
"Gender": Gender,
|
| 133 |
-
"CityTier": CityTier,
|
| 134 |
-
"MaritalStatus": MaritalStatus,
|
| 135 |
-
"MonthlyIncome": MonthlyIncome,
|
| 136 |
-
"Occupation": Occupation,
|
| 137 |
-
"NumberOfTrips": NumberOfTrips,
|
| 138 |
-
"NumberOfAdultsVisiting": NumberOfAdultsVisiting,
|
| 139 |
-
"NumberOfChildrenVisiting": NumberOfChildrenVisiting,
|
| 140 |
-
"PitchDuration": DurationOfPitch,
|
| 141 |
-
"NumberOfFollowups": NumberOfFollowups,
|
| 142 |
-
"PreferredProperty": PreferredProperty,
|
| 143 |
-
"PitchSatisfaction": PitchSatisfaction,
|
| 144 |
-
"ProductPitched": ProductPitched,
|
| 145 |
-
"TourType": TourType,
|
| 146 |
-
"Passport": Passport
|
| 147 |
-
}
|
| 148 |
-
|
| 149 |
-
input_df = pd.DataFrame([input_data])
|
| 150 |
-
|
| 151 |
# ---------------------------------------------------------
|
| 152 |
# Prediction Button
|
| 153 |
# ---------------------------------------------------------
|
|
|
|
| 62 |
# ---------------------------------------------------------
|
| 63 |
# PERSONAL INFORMATION
|
| 64 |
# ---------------------------------------------------------
|
| 65 |
+
with st.expander("👤 1. Personal and Professional Information", expanded=True):
|
| 66 |
+
#st.markdown('<div class="card">', unsafe_allow_html=True)
|
| 67 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 68 |
|
| 69 |
+
col1, col2 = st.columns(3)
|
| 70 |
with col1:
|
| 71 |
Age = st.number_input("Age", 18, 90, 30)
|
| 72 |
Gender = st.selectbox("Gender", ["Male", "Female"])
|
| 73 |
+
MaritalStatus = st.selectbox("Marital Status", ["Single", "Married", "Divorced"])
|
|
|
|
| 74 |
|
| 75 |
with col2:
|
| 76 |
+
CityTier_label = st.selectbox("City Tier", ["Tier 1", "Tier 2", "Tier 3"])
|
| 77 |
+
#OwnCar = st.selectbox("Owns a Car?", [0, 1])
|
| 78 |
+
#Passport = st.selectbox("Has Passport?", [0, 1])
|
| 79 |
+
OwnCar_display = st.radio("Own Car?", ["Yes", "No"])
|
| 80 |
+
Passport_display = st.radio("Has Passport?", ["Yes", "No"])
|
| 81 |
+
|
| 82 |
+
with col3:
|
| 83 |
Occupation = st.selectbox("Occupation", ["Salaried", "Self Employed", "Entrepreneur"])
|
| 84 |
+
Designation = st.selectbox("Designation", Designation_vals)
|
| 85 |
+
MonthlyIncome = st.number_input("Monthly Income (₹)", 0, 500000, 50000)
|
| 86 |
|
| 87 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 88 |
|
| 89 |
+
#convert City Tier to numeric
|
| 90 |
CityTier = {"Tier 1": 1, "Tier 2": 2, "Tier 3": 3}[CityTier_label]
|
| 91 |
|
| 92 |
+
# Convert Yes/No → 1/0
|
| 93 |
+
OwnCar = 1 if OwnCar_display == "Yes" else 0
|
| 94 |
+
Passport = 1 if Passport_display == "Yes" else 0
|
| 95 |
+
|
| 96 |
|
| 97 |
# ---------------------------------------------------------
|
| 98 |
# TRAVEL INFORMATION
|
| 99 |
# ---------------------------------------------------------
|
| 100 |
with st.expander("✈️ 2. Travel Information"):
|
| 101 |
+
#st.markdown('<div class="card">', unsafe_allow_html=True)
|
| 102 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 103 |
|
| 104 |
col1, col2 = st.columns(2)
|
| 105 |
with col1:
|
|
|
|
| 117 |
# INTERACTION INFORMATION
|
| 118 |
# ---------------------------------------------------------
|
| 119 |
with st.expander("🗣️ 3. Interaction Details"):
|
| 120 |
+
#st.markdown('<div class="card">', unsafe_allow_html=True)
|
| 121 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 122 |
|
| 123 |
col1, col2 = st.columns(2)
|
| 124 |
|
| 125 |
with col1:
|
| 126 |
+
TypeofContact = st.selectbox("Type of Contact", ["Company Invited", "Self Inquiry"])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
ProductPitched = st.selectbox("Product Pitched",
|
| 128 |
["Basic", "Standard", "Deluxe", "Luxury"])
|
| 129 |
|
|
|
|
| 130 |
|
| 131 |
+
with col2:
|
| 132 |
+
DurationOfPitch = st.number_input("Pitch Duration (minutes)", 0, 200, 10)
|
| 133 |
+
NumberOfFollowups = st.number_input("Number of Follow-ups", 0, 20, 1)
|
| 134 |
+
|
| 135 |
+
with col3:
|
| 136 |
+
PitchSatisfactionScore = st.selectbox("Pitch Satisfaction Score", [1, 2, 3, 4, 5])
|
| 137 |
+
|
| 138 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 139 |
|
| 140 |
+
# --------------------------
|
| 141 |
+
# Prepare input data frame
|
| 142 |
+
# ------------------------
|
| 143 |
+
input_data = {
|
| 144 |
+
"Age": Age,
|
| 145 |
+
"TypeofContact": TypeofContact,
|
| 146 |
+
"CityTier": CityTier,
|
| 147 |
+
"DurationOfPitch": DurationOfPitch,
|
| 148 |
+
"Occupation": Occupation,
|
| 149 |
+
"Gender": Gender,
|
| 150 |
+
"NumberOfPersonVisiting": NumberOfPersonVisiting,
|
| 151 |
+
"NumberOfFollowups": NumberOfFollowups,
|
| 152 |
+
"ProductPitched": ProductPitched,
|
| 153 |
+
"PreferredPropertyStar": PreferredPropertyStar,
|
| 154 |
+
"MaritalStatus": MaritalStatus,
|
| 155 |
+
"NumberOfTrips": NumberOfTrips,
|
| 156 |
+
"Passport": Passport,
|
| 157 |
+
"PitchSatisfactionScore": PitchSatisfactionScore,
|
| 158 |
+
"OwnCar": OwnCar,
|
| 159 |
+
"NumberOfChildrenVisiting": NumberOfChildrenVisiting,
|
| 160 |
+
"Designation": Designation,
|
| 161 |
+
"MonthlyIncome": MonthlyIncome
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
input_df = pd.DataFrame([input_data])
|
| 165 |
+
|
| 166 |
|
| 167 |
# ---------------------------------------------------------
|
| 168 |
# Predict Button
|
| 169 |
# ---------------------------------------------------------
|
| 170 |
if st.button("🔮 Predict"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
# ---------------------------------------------------------
|
| 172 |
# Prediction Button
|
| 173 |
# ---------------------------------------------------------
|