Isabel Gwara commited on
Commit
43ff360
·
1 Parent(s): 538a20c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -109,7 +109,7 @@ def general_predictor(input_list):
109
  # predict single datapoint
110
  new_input = [features]
111
  result = model.predict(new_input)
112
- return cat_value_dicts[final_colname][result[0]]
113
 
114
  # add data labels to replace those lost via star-args
115
  inputls = []
@@ -129,9 +129,10 @@ for colname in data.columns:
129
 
130
  # generate gradio interface
131
  if col2.button("Submit"):
132
- prediction = general_predictor(inputls)
133
 
134
- st.text(f"Your recommendation: {prediction}")
 
135
 
136
  with open('info.md') as f:
137
  st.markdown(f.read())
 
109
  # predict single datapoint
110
  new_input = [features]
111
  result = model.predict(new_input)
112
+ return [cat_value_dicts[final_colname][result[0]], cat_value_dicts[final_colname][result[1]]]
113
 
114
  # add data labels to replace those lost via star-args
115
  inputls = []
 
129
 
130
  # generate gradio interface
131
  if col2.button("Submit"):
132
+ results = general_predictor(inputls)
133
 
134
+ st.text(f"Your most likley recommendation: {results[0]}")
135
+ st.text(f"Your second best recommendation: {results[1]}")
136
 
137
  with open('info.md') as f:
138
  st.markdown(f.read())