lrschuman17 commited on
Commit
f633c03
·
verified ·
1 Parent(s): 479a2cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -163,9 +163,15 @@ def main():
163
  # Predict and display results
164
  if st.sidebar.button("Predict"):
165
  predictions = rf_model.predict(input_data)
166
- prediction_columns = ["Predicted Change in PTS", "Predicted Change in REB", "Predicted Change inAST"]
 
 
 
 
 
167
  st.subheader("Predicted Post-Injury Performance")
168
  st.write("Based on the inputs, here are the predicted metrics:")
 
169
  st.table(pd.DataFrame(predictions, columns=prediction_columns))
170
  except FileNotFoundError:
171
  st.error("Model file not found.")
 
163
  # Predict and display results
164
  if st.sidebar.button("Predict"):
165
  predictions = rf_model.predict(input_data)
166
+ # Round predictions to two decimal places
167
+ predictions = predictions.round(2)
168
+
169
+ # Define column names for the output table
170
+ prediction_columns = ["Predicted Change in PTS", "Predicted Change in REB", "Predicted Change in AST"]
171
+
172
  st.subheader("Predicted Post-Injury Performance")
173
  st.write("Based on the inputs, here are the predicted metrics:")
174
+ st.table(pd.DataFrame([predictions], columns=prediction_columns))
175
  st.table(pd.DataFrame(predictions, columns=prediction_columns))
176
  except FileNotFoundError:
177
  st.error("Model file not found.")