Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,12 +57,32 @@ def humands(Sex,Age,Married,Monthlyincome,TotalWorkingYears,DistanceFromHome,Ove
|
|
57 |
"JobRole_Healthcare Representative" : [0],
|
58 |
"EducationField_Human Resources" : [0],
|
59 |
"JobRole_Manager" : [0],
|
60 |
-
"JobRole_Research Director" : [0],
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
}
|
65 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
pred = model.predict(df)[0]
|
68 |
|
|
|
57 |
"JobRole_Healthcare Representative" : [0],
|
58 |
"EducationField_Human Resources" : [0],
|
59 |
"JobRole_Manager" : [0],
|
60 |
+
"JobRole_Research Director" : [0],
|
|
|
|
|
|
|
61 |
}
|
62 |
)
|
63 |
+
|
64 |
+
columnas = ['Age', 'DailyRate', 'DistanceFromHome', 'Education',
|
65 |
+
'EnvironmentSatisfaction', 'HourlyRate', 'JobInvolvement', 'JobLevel',
|
66 |
+
'JobSatisfaction', 'MonthlyIncome', 'MonthlyRate', 'NumCompaniesWorked',
|
67 |
+
'PercentSalaryHike', 'PerformanceRating', 'RelationshipSatisfaction',
|
68 |
+
'StockOptionLevel', 'TotalWorkingYears', 'TrainingTimesLastYear',
|
69 |
+
'WorkLifeBalance', 'YearsAtCompany', 'YearsInCurrentRole',
|
70 |
+
'YearsSinceLastPromotion', 'YearsWithCurrManager',
|
71 |
+
'BusinessTravel_Non-Travel', 'BusinessTravel_Travel_Frequently',
|
72 |
+
'BusinessTravel_Travel_Rarely', 'Department_Human Resources',
|
73 |
+
'Department_Research & Development', 'Department_Sales',
|
74 |
+
'EducationField_Human Resources', 'EducationField_Life Sciences',
|
75 |
+
'EducationField_Marketing', 'EducationField_Medical',
|
76 |
+
'EducationField_Other', 'EducationField_Technical Degree',
|
77 |
+
'Gender_Female', 'Gender_Male', 'JobRole_Healthcare Representative',
|
78 |
+
'JobRole_Human Resources', 'JobRole_Laboratory Technician',
|
79 |
+
'JobRole_Manager', 'JobRole_Manufacturing Director',
|
80 |
+
'JobRole_Research Director', 'JobRole_Research Scientist',
|
81 |
+
'JobRole_Sales Executive', 'JobRole_Sales Representative',
|
82 |
+
'MaritalStatus_Divorced', 'MaritalStatus_Married',
|
83 |
+
'MaritalStatus_Single', 'OverTime_No', 'OverTime_Yes']
|
84 |
+
|
85 |
+
df = df.reindex(columns=columnas)
|
86 |
|
87 |
pred = model.predict(df)[0]
|
88 |
|