rasmodev commited on
Commit
e2b803d
·
verified ·
1 Parent(s): 226dd1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -12
app.py CHANGED
@@ -32,44 +32,50 @@ def main():
32
  # Column 1
33
  with col1:
34
  age = st.slider("Age", min_value=18, max_value=70, value=30)
35
- distance_from_home = st.slider("Distance From Home", min_value=1, max_value=30, value=10)
 
 
36
  environment_satisfaction = st.select_slider("Environment Satisfaction", options=[1, 2, 3, 4], value=2)
37
- hourly_rate = st.slider("Hourly Rate", min_value=30, max_value=100, value=65)
38
- job_involvement = st.select_slider("Job Involvement", options=[1, 2, 3, 4], value=2)
 
39
 
40
  # Column 2
41
  with col2:
42
- job_level = st.select_slider("Job Level", options=[1, 2, 3, 4, 5], value=3)
43
- job_satisfaction = st.select_slider("Job Satisfaction", options=[1, 2, 3, 4], value=2)
44
  monthly_income = st.slider("Monthly Income", min_value=1000, max_value=20000, value=5000)
45
  num_companies_worked = st.slider("Number of Companies Worked", min_value=0, max_value=10, value=2)
46
  over_time = st.checkbox("Over Time")
 
 
 
47
 
48
  # Column 3
49
  with col3:
50
- percent_salary_hike = st.slider("Percent Salary Hike", min_value=10, max_value=25, value=15)
51
- stock_option_level = st.select_slider("Stock Option Level", options=[0, 1, 2, 3], value=1)
52
  training_times_last_year = st.slider("Training Times Last Year", min_value=0, max_value=6, value=2)
53
  work_life_balance = st.select_slider("Work Life Balance", options=[1, 2, 3, 4], value=2)
 
54
  years_since_last_promotion = st.slider("Years Since Last Promotion", min_value=0, max_value=15, value=3)
55
- years_with_curr_manager = st.slider("Years With Current Manager", min_value=0, max_value=15, value=3)
56
 
57
  # Create a DataFrame to hold the user input data
58
  input_data = pd.DataFrame({
59
  'Age': [age],
60
- 'DistanceFromHome': [distance_from_home],
 
 
61
  'EnvironmentSatisfaction': [environment_satisfaction],
62
- 'HourlyRate': [hourly_rate],
63
- 'JobInvolvement': [job_involvement],
64
- 'JobLevel': [job_level],
65
  'JobSatisfaction': [job_satisfaction],
66
  'MonthlyIncome': [monthly_income],
67
  'NumCompaniesWorked': [num_companies_worked],
68
  'OverTime': [over_time],
69
  'PercentSalaryHike': [percent_salary_hike],
 
70
  'StockOptionLevel': [stock_option_level],
71
  'TrainingTimesLastYear': [training_times_last_year],
72
  'WorkLifeBalance': [work_life_balance],
 
73
  'YearsSinceLastPromotion': [years_since_last_promotion],
74
  'YearsWithCurrManager': [years_with_curr_manager]
75
  })
 
32
  # Column 1
33
  with col1:
34
  age = st.slider("Age", min_value=18, max_value=70, value=30)
35
+ business_travel = st.selectbox("Business Travel", options=['Travel_Rarely', 'Travel_Frequently', 'Non-Travel'])
36
+ department = st.selectbox("Department", options=['Sales', 'Research & Development', 'Human Resources'])
37
+ education_field = st.selectbox("Education Field", options=['Life Sciences', 'Other', 'Medical', 'Marketing', 'Technical Degree', 'Human Resources'])
38
  environment_satisfaction = st.select_slider("Environment Satisfaction", options=[1, 2, 3, 4], value=2)
39
+ gender = st.radio("Gender", options=['Female', 'Male'])
40
+ job_role = st.selectbox("Job Role", options=['Sales Executive', 'Research Scientist', 'Laboratory Technician', 'Manufacturing Director', 'Healthcare Representative', 'Manager', 'Sales Representative', 'Research Director', 'Human Resources'])
41
+ job_satisfaction = st.select_slider("Job Satisfaction", options=[1, 2, 3, 4], value=2)
42
 
43
  # Column 2
44
  with col2:
 
 
45
  monthly_income = st.slider("Monthly Income", min_value=1000, max_value=20000, value=5000)
46
  num_companies_worked = st.slider("Number of Companies Worked", min_value=0, max_value=10, value=2)
47
  over_time = st.checkbox("Over Time")
48
+ percent_salary_hike = st.slider("Percent Salary Hike", min_value=10, max_value=25, value=15)
49
+ relationship_satisfaction = st.select_slider("Relationship Satisfaction", options=[1, 2, 3, 4], value=2)
50
+ stock_option_level = st.select_slider("Stock Option Level", options=[0, 1, 2, 3], value=1)
51
 
52
  # Column 3
53
  with col3:
 
 
54
  training_times_last_year = st.slider("Training Times Last Year", min_value=0, max_value=6, value=2)
55
  work_life_balance = st.select_slider("Work Life Balance", options=[1, 2, 3, 4], value=2)
56
+ years_at_company = st.slider("Years at Company", min_value=0, max_value=40, value=5)
57
  years_since_last_promotion = st.slider("Years Since Last Promotion", min_value=0, max_value=15, value=3)
58
+ years_with_curr_manager = st.slider("Years With Current Manager", min_value=0, max_value=17, value=5)
59
 
60
  # Create a DataFrame to hold the user input data
61
  input_data = pd.DataFrame({
62
  'Age': [age],
63
+ 'BusinessTravel': [business_travel],
64
+ 'Department': [department],
65
+ 'EducationField': [education_field],
66
  'EnvironmentSatisfaction': [environment_satisfaction],
67
+ 'Gender': [gender],
68
+ 'JobRole': [job_role],
 
69
  'JobSatisfaction': [job_satisfaction],
70
  'MonthlyIncome': [monthly_income],
71
  'NumCompaniesWorked': [num_companies_worked],
72
  'OverTime': [over_time],
73
  'PercentSalaryHike': [percent_salary_hike],
74
+ 'RelationshipSatisfaction': [relationship_satisfaction],
75
  'StockOptionLevel': [stock_option_level],
76
  'TrainingTimesLastYear': [training_times_last_year],
77
  'WorkLifeBalance': [work_life_balance],
78
+ 'YearsAtCompany': [years_at_company],
79
  'YearsSinceLastPromotion': [years_since_last_promotion],
80
  'YearsWithCurrManager': [years_with_curr_manager]
81
  })