Parthebhan commited on
Commit
fbcffad
·
verified ·
1 Parent(s): c982ed5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -7,17 +7,13 @@ with open('./salifort_rf3.pickle', 'rb') as file:
7
 
8
  # Define the function for making predictions
9
  def salifort(last_evaluation, number_project, tenure, work_accident, promotion_last_5years, salary, department_IT, department_RandD, department_accounting, department_hr, department_management, department_marketing, department_product_mng, department_sales, department_support, department_technical, overworked):
10
- inputs = [['last_evaluation', 'number_project', 'tenure', 'work_accident',
11
- 'promotion_last_5years', 'salary', 'department_IT', 'department_RandD',
12
- 'department_accounting', 'department_hr', 'department_management',
13
- 'department_marketing', 'department_product_mng', 'department_sales',
14
- 'department_support', 'department_technical', 'overworked']]
15
- prediction = model.predict(inputs)
16
- prediction_value = prediction[0][0]
17
  if prediction_value == 0:
18
- label_text = 'employee would not leave the company'
19
  else:
20
- label_text = 'employee will leave the company'
21
  return label_text
22
 
23
  # Create the Gradio interface
 
7
 
8
  # Define the function for making predictions
9
  def salifort(last_evaluation, number_project, tenure, work_accident, promotion_last_5years, salary, department_IT, department_RandD, department_accounting, department_hr, department_management, department_marketing, department_product_mng, department_sales, department_support, department_technical, overworked):
10
+ inputs = [[float(last_evaluation), float(number_project), float(tenure), float(work_accident), float(promotion_last_5years), float(salary), float(department_IT), float(department_RandD), float(department_accounting), float(department_hr), float(department_management), float(department_marketing), float(department_product_mng), float(department_sales), float(department_support), float(department_technical), float(overworked)]]
11
+ prediction = model.predict(inputs)
12
+ prediction_value = prediction[0]
 
 
 
 
13
  if prediction_value == 0:
14
+ label_text = 'Employee would not leave the company.'
15
  else:
16
+ label_text = 'Employee will leave the company.'
17
  return label_text
18
 
19
  # Create the Gradio interface