Update app.py
Browse files
app.py
CHANGED
@@ -242,7 +242,6 @@ def prediction():
|
|
242 |
st.sidebar.markdown("**Occupation Code**: Choose the category code of the occupation of the individual (e.g., Category X, Category Y).")
|
243 |
st.sidebar.markdown("**Major Occupation Code**: Select the major occupation code of the individual (e.g., Occupation 1, Occupation 2).")
|
244 |
st.sidebar.markdown("**Total Employed**: Specify the number of persons worked for the employer (numeric value, e.g., 3, 5).")
|
245 |
-
st.sidebar.markdown("**Household Stat**: Choose the detailed household and family status of the individual (e.g., Single, Married-civilian spouse present).")
|
246 |
st.sidebar.markdown("**Household Summary**: Select the detailed household summary (e.g., Child under 18 never married, Spouse of householder).")
|
247 |
st.sidebar.markdown("**Veteran Benefits**: Choose whether the individual receives veteran benefits (Yes or No).")
|
248 |
st.sidebar.markdown("**Tax Filer Status**: Select the tax filer status of the individual (e.g., Single, Joint both 65+).")
|
@@ -250,8 +249,6 @@ def prediction():
|
|
250 |
st.sidebar.markdown("**Losses**: Specify any losses the individual has (numeric value, e.g., 300.0).")
|
251 |
st.sidebar.markdown("**Dividends from Stocks**: Specify any dividends from stocks for the individual (numeric value, e.g., 120.5).")
|
252 |
st.sidebar.markdown("**Citizenship**: Select the citizenship status of the individual (e.g., Native, Foreign Born- Not a citizen of U S).")
|
253 |
-
st.sidebar.markdown("**Year of Migration**: Enter the year of migration for the individual (numeric value, e.g., 2005).")
|
254 |
-
st.sidebar.markdown("**Country of Birth**: Choose the individual's birth country (e.g., United-States, Other).")
|
255 |
st.sidebar.markdown("**Importance of Record**: Enter the weight of the instance (numeric value, e.g., 0.9).")
|
256 |
|
257 |
# Create the input fields in the order of your DataFrame
|
@@ -272,7 +269,6 @@ def prediction():
|
|
272 |
'occupation_code': 0, # Default value
|
273 |
'occupation_code_main': unique_values['occupation_code_main'][0],
|
274 |
'total_employed': 0, # Default value
|
275 |
-
'household_stat': unique_values['household_stat'][0],
|
276 |
'household_summary': unique_values['household_summary'][0],
|
277 |
'vet_benefit': 0, # Default value
|
278 |
'tax_status': unique_values['tax_status'][0],
|
@@ -280,8 +276,6 @@ def prediction():
|
|
280 |
'losses': 0, # Default value
|
281 |
'stocks_status': 0, # Default value
|
282 |
'citizenship': unique_values['citizenship'][0],
|
283 |
-
'mig_year': 0,
|
284 |
-
'country_of_birth_own': 'United-States',
|
285 |
'importance_of_record': 0.0 # Default value
|
286 |
}
|
287 |
|
@@ -307,7 +301,6 @@ def prediction():
|
|
307 |
input_data['occupation_code'] = st.selectbox("Category Code of Occupation", unique_values['occupation_code'], key='occupation_code')
|
308 |
input_data['occupation_code_main'] = st.selectbox("Major Occupation Code", unique_values['occupation_code_main'], key='occupation_code_main')
|
309 |
input_data['total_employed'] = st.number_input("Number of Persons Worked for Employer", min_value=0, key='total_employed')
|
310 |
-
input_data['household_stat'] = st.selectbox("Detailed Household and Family Status", unique_values['household_stat'], key='household_stat')
|
311 |
input_data['household_summary'] = st.selectbox("Detailed Household Summary", unique_values['household_summary'], key='household_summary')
|
312 |
input_data['vet_benefit'] = st.selectbox("Veteran Benefits", unique_values['vet_benefit'], key='vet_benefit')
|
313 |
|
@@ -317,8 +310,6 @@ def prediction():
|
|
317 |
input_data['losses'] = st.number_input("Losses", min_value=0, key='losses')
|
318 |
input_data['stocks_status'] = st.number_input("Dividends from Stocks", min_value=0, key='stocks_status')
|
319 |
input_data['citizenship'] = st.selectbox("Citizenship", unique_values['citizenship'], key='citizenship')
|
320 |
-
input_data['mig_year'] = st.selectbox("Migration Year", unique_values['mig_year'], key='migration_year')
|
321 |
-
input_data['country_of_birth_own'] = st.selectbox("Country of Birth", unique_values['country_of_birth_own'], key='country_of_birth_own')
|
322 |
input_data['importance_of_record'] = st.number_input("Importance of Record", min_value=0, key='importance_of_record')
|
323 |
|
324 |
# Button to make predictions
|
|
|
242 |
st.sidebar.markdown("**Occupation Code**: Choose the category code of the occupation of the individual (e.g., Category X, Category Y).")
|
243 |
st.sidebar.markdown("**Major Occupation Code**: Select the major occupation code of the individual (e.g., Occupation 1, Occupation 2).")
|
244 |
st.sidebar.markdown("**Total Employed**: Specify the number of persons worked for the employer (numeric value, e.g., 3, 5).")
|
|
|
245 |
st.sidebar.markdown("**Household Summary**: Select the detailed household summary (e.g., Child under 18 never married, Spouse of householder).")
|
246 |
st.sidebar.markdown("**Veteran Benefits**: Choose whether the individual receives veteran benefits (Yes or No).")
|
247 |
st.sidebar.markdown("**Tax Filer Status**: Select the tax filer status of the individual (e.g., Single, Joint both 65+).")
|
|
|
249 |
st.sidebar.markdown("**Losses**: Specify any losses the individual has (numeric value, e.g., 300.0).")
|
250 |
st.sidebar.markdown("**Dividends from Stocks**: Specify any dividends from stocks for the individual (numeric value, e.g., 120.5).")
|
251 |
st.sidebar.markdown("**Citizenship**: Select the citizenship status of the individual (e.g., Native, Foreign Born- Not a citizen of U S).")
|
|
|
|
|
252 |
st.sidebar.markdown("**Importance of Record**: Enter the weight of the instance (numeric value, e.g., 0.9).")
|
253 |
|
254 |
# Create the input fields in the order of your DataFrame
|
|
|
269 |
'occupation_code': 0, # Default value
|
270 |
'occupation_code_main': unique_values['occupation_code_main'][0],
|
271 |
'total_employed': 0, # Default value
|
|
|
272 |
'household_summary': unique_values['household_summary'][0],
|
273 |
'vet_benefit': 0, # Default value
|
274 |
'tax_status': unique_values['tax_status'][0],
|
|
|
276 |
'losses': 0, # Default value
|
277 |
'stocks_status': 0, # Default value
|
278 |
'citizenship': unique_values['citizenship'][0],
|
|
|
|
|
279 |
'importance_of_record': 0.0 # Default value
|
280 |
}
|
281 |
|
|
|
301 |
input_data['occupation_code'] = st.selectbox("Category Code of Occupation", unique_values['occupation_code'], key='occupation_code')
|
302 |
input_data['occupation_code_main'] = st.selectbox("Major Occupation Code", unique_values['occupation_code_main'], key='occupation_code_main')
|
303 |
input_data['total_employed'] = st.number_input("Number of Persons Worked for Employer", min_value=0, key='total_employed')
|
|
|
304 |
input_data['household_summary'] = st.selectbox("Detailed Household Summary", unique_values['household_summary'], key='household_summary')
|
305 |
input_data['vet_benefit'] = st.selectbox("Veteran Benefits", unique_values['vet_benefit'], key='vet_benefit')
|
306 |
|
|
|
310 |
input_data['losses'] = st.number_input("Losses", min_value=0, key='losses')
|
311 |
input_data['stocks_status'] = st.number_input("Dividends from Stocks", min_value=0, key='stocks_status')
|
312 |
input_data['citizenship'] = st.selectbox("Citizenship", unique_values['citizenship'], key='citizenship')
|
|
|
|
|
313 |
input_data['importance_of_record'] = st.number_input("Importance of Record", min_value=0, key='importance_of_record')
|
314 |
|
315 |
# Button to make predictions
|