File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Job Satisfaction Analysis Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 80
80
input_df = input_df [features ]
81
81
82
82
# Make prediction
83
- prediction = model .predict (input_df )
83
+ prediction_numeric = model .predict (input_df )[ 0 ]
84
84
85
85
# Display the prediction
86
- st .write (f'Predicted Job Satisfaction: { prediction [0 ]} ' )
86
+ satisfaction_categories = [
87
+ 'Extremely dissatisfied' ,
88
+ 'Moderately dissatisfied' ,
89
+ 'Slightly dissatisfied' ,
90
+ 'Neither satisfied nor dissatisfied' ,
91
+ 'Slightly satisfied' ,
92
+ 'Moderately satisfied' ,
93
+ 'Extremely satisfied'
94
+ ]
95
+
96
+ # Map numeric prediction to category label
97
+ prediction_label = satisfaction_categories [int (prediction_numeric )]
98
+
99
+ # Display the prediction in categorical form
100
+ st .write (f'Predicted Job Satisfaction: { prediction_label } ' )
101
+
You can’t perform that action at this time.
0 commit comments