Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -15,6 +15,29 @@ import joblib
|
|
| 15 |
model_path = hf_hub_download(repo_id="harishsohani/MLOP-Project-Tourism", filename="best_tourism_model.joblib")
|
| 16 |
model = joblib.load(model_path)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# ---------------------------------------------------------
|
| 19 |
# UI OPTIMIZATION (CSS + Layout Tweaks)
|
| 20 |
# ---------------------------------------------------------
|
|
@@ -69,18 +92,18 @@ with st.expander("👤 1. Personal and Professional Information", expanded=True)
|
|
| 69 |
col1, col2, col3 = st.columns(3)
|
| 70 |
with col1:
|
| 71 |
Age = st.number_input("Age", 18, 90, 30)
|
| 72 |
-
Gender = st.selectbox("Gender",
|
| 73 |
-
MaritalStatus = st.selectbox("Marital Status",
|
| 74 |
|
| 75 |
with col2:
|
| 76 |
-
CityTier_label = st.selectbox("City Tier",
|
| 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",
|
| 84 |
Designation = st.selectbox("Designation", Designation_vals)
|
| 85 |
MonthlyIncome = st.number_input("Monthly Income (₹)", 0, 500000, 50000)
|
| 86 |
|
|
@@ -124,13 +147,12 @@ with st.expander("🗣️ 3. Interaction Details"):
|
|
| 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,
|
| 134 |
|
| 135 |
with col3:
|
| 136 |
PitchSatisfactionScore = st.selectbox("Pitch Satisfaction Score", [1, 2, 3, 4, 5])
|
|
|
|
| 15 |
model_path = hf_hub_download(repo_id="harishsohani/MLOP-Project-Tourism", filename="best_tourism_model.joblib")
|
| 16 |
model = joblib.load(model_path)
|
| 17 |
|
| 18 |
+
# Define predefines set values for each input applicable
|
| 19 |
+
TypeofContact_vals = ['Self Enquiry', 'Company Invited']
|
| 20 |
+
|
| 21 |
+
Occupation_vals = ['Salaried', 'Free Lancer', 'Small Business', 'Large Business']
|
| 22 |
+
|
| 23 |
+
Gender_vals = ['Female', 'Male']
|
| 24 |
+
|
| 25 |
+
ProductPitched_vals = ['Deluxe', 'Basic', 'Standard', 'Super Deluxe', 'King']
|
| 26 |
+
|
| 27 |
+
MaritalStatus_vals = ['Single', 'Divorced', 'Married', 'Unmarried']
|
| 28 |
+
|
| 29 |
+
Designation_vals = ['Manager', 'Executive', 'Senior Manager', 'AVP', 'VP']
|
| 30 |
+
|
| 31 |
+
CityType = [ "Tier 1", "Tier 2", "Tier3"]
|
| 32 |
+
|
| 33 |
+
CityTier_vals = [1, 2, 3]
|
| 34 |
+
|
| 35 |
+
PreferredPropertyStar_vals = [3.0, 4.0, 5.0]
|
| 36 |
+
|
| 37 |
+
NumberOfTrips_vals = [1, 2, 7, 5, 6, 3, 4, 19, 21, 8, 20, 22]
|
| 38 |
+
|
| 39 |
+
PitchSatisfactionScore_vals = [1, 2, 3, 4, 5]
|
| 40 |
+
|
| 41 |
# ---------------------------------------------------------
|
| 42 |
# UI OPTIMIZATION (CSS + Layout Tweaks)
|
| 43 |
# ---------------------------------------------------------
|
|
|
|
| 92 |
col1, col2, col3 = st.columns(3)
|
| 93 |
with col1:
|
| 94 |
Age = st.number_input("Age", 18, 90, 30)
|
| 95 |
+
Gender = st.selectbox("Gender", Gender_vals)
|
| 96 |
+
MaritalStatus = st.selectbox("Marital Status", MaritalStatus_vals)
|
| 97 |
|
| 98 |
with col2:
|
| 99 |
+
CityTier_label = st.selectbox("City Tier", CityType)
|
| 100 |
#OwnCar = st.selectbox("Owns a Car?", [0, 1])
|
| 101 |
#Passport = st.selectbox("Has Passport?", [0, 1])
|
| 102 |
OwnCar_display = st.radio("Own Car?", ["Yes", "No"])
|
| 103 |
Passport_display = st.radio("Has Passport?", ["Yes", "No"])
|
| 104 |
|
| 105 |
with col3:
|
| 106 |
+
Occupation = st.selectbox("Occupation", Occupation_vals)
|
| 107 |
Designation = st.selectbox("Designation", Designation_vals)
|
| 108 |
MonthlyIncome = st.number_input("Monthly Income (₹)", 0, 500000, 50000)
|
| 109 |
|
|
|
|
| 147 |
|
| 148 |
with col1:
|
| 149 |
TypeofContact = st.selectbox("Type of Contact", ["Company Invited", "Self Inquiry"])
|
| 150 |
+
ProductPitched = st.selectbox("Product Pitched", ProductPitched_vals)
|
|
|
|
| 151 |
|
| 152 |
|
| 153 |
with col2:
|
| 154 |
DurationOfPitch = st.number_input("Pitch Duration (minutes)", 0, 200, 10)
|
| 155 |
+
NumberOfFollowups = st.number_input("Number of Follow-ups", 0, 50, 1)
|
| 156 |
|
| 157 |
with col3:
|
| 158 |
PitchSatisfactionScore = st.selectbox("Pitch Satisfaction Score", [1, 2, 3, 4, 5])
|