analist commited on
Commit
d1f775d
·
1 Parent(s): 64391fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -23,8 +23,6 @@ to_use_cols = ['as_of_year', 'county_name', 'applicant_sex_name', 'action_taken_
23
 
24
  data_reduced = data[to_use_cols]
25
 
26
- data_reduced.shape
27
-
28
  data_no_na = data_reduced.dropna()
29
 
30
 
@@ -37,14 +35,11 @@ mapped = {tuple(succeeded): 1, tuple(failed): 2, tuple(user_error): 3}
37
  def mapped(x):
38
  if x in succeeded:
39
  return 1
40
- elif x in failed:
41
- return 0
42
  else:
43
- return 2
44
 
45
  data_no_na.action_taken_name = data_no_na.action_taken_name.apply(mapped)
46
 
47
- data_no_na.loan_type_name.value_counts()
48
 
49
  mapped_type = {
50
  'Conventional': 0,
@@ -126,7 +121,7 @@ with col1:
126
  submitted = st.form_submit_button("Submit")
127
  if submitted:
128
  col2.info('Predicting')
129
- new_demand = np.array(mapping(county=county, sex=sex, property_type=property_type, loan=loan, income=income, loan_amount=loan_amount).values())
130
  if model_choice == 'Tree':
131
  col2.markdown(tree.predict(new_demand))
132
  elif model_choice == 'RandomForest':
 
23
 
24
  data_reduced = data[to_use_cols]
25
 
 
 
26
  data_no_na = data_reduced.dropna()
27
 
28
 
 
35
  def mapped(x):
36
  if x in succeeded:
37
  return 1
 
 
38
  else:
39
+ return 0
40
 
41
  data_no_na.action_taken_name = data_no_na.action_taken_name.apply(mapped)
42
 
 
43
 
44
  mapped_type = {
45
  'Conventional': 0,
 
121
  submitted = st.form_submit_button("Submit")
122
  if submitted:
123
  col2.info('Predicting')
124
+ new_demand = np.array(list(mapping(county=county, sex=sex, property_type=property_type, loan=loan, income=income, loan_amount=loan_amount).values()))
125
  if model_choice == 'Tree':
126
  col2.markdown(tree.predict(new_demand))
127
  elif model_choice == 'RandomForest':