Skip to content

Commit

Permalink
Display predictions in categorical form
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvi0909 committed Oct 29, 2024
1 parent 7ed6137 commit bd0297c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Job Satisfaction Analysis/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,22 @@
input_df = input_df[features]

# Make prediction
prediction = model.predict(input_df)
prediction_numeric = model.predict(input_df)[0]

# Display the prediction
st.write(f'Predicted Job Satisfaction: {prediction[0]}')
satisfaction_categories = [
'Extremely dissatisfied',
'Moderately dissatisfied',
'Slightly dissatisfied',
'Neither satisfied nor dissatisfied',
'Slightly satisfied',
'Moderately satisfied',
'Extremely satisfied'
]

# Map numeric prediction to category label
prediction_label = satisfaction_categories[int(prediction_numeric)]

# Display the prediction in categorical form
st.write(f'Predicted Job Satisfaction: {prediction_label}')

0 comments on commit bd0297c

Please sign in to comment.