""" Employee Growth Score Prediction - Inference Script ===================================================== Load the trained model and predict growth scores for new employees. """ import joblib import numpy as np # Load model model = joblib.load("employee_growth_model.joblib") # Feature columns (in order): # Age, BusinessTravel_Num, DailyRate, Department_Num, DistanceFromHome, # EnvironmentSatisfaction, JobInvolvement, JobLevel, JobRole_Num, # JobSatisfaction, MaritalStatus_Num, MonthlyIncome, TotalWorkingYears, # YearsAtCompany, YearsInCurrentRole, YearsSinceLastPromotion, YearsWithCurrManager # Example: Predict for a new employee new_employee = np.array([[ 30, # Age 2, # BusinessTravel_Num (1=No, 2=Travel_Rarely, 3=Travel_Frequently) 800, # DailyRate 2, # Department_Num 5, # DistanceFromHome 3, # EnvironmentSatisfaction (1-4) 3, # JobInvolvement (1-4) 2, # JobLevel (1-5) 5, # JobRole_Num 3, # JobSatisfaction (1-4) 1, # MaritalStatus_Num 5000, # MonthlyIncome 8, # TotalWorkingYears 5, # YearsAtCompany 3, # YearsInCurrentRole 1, # YearsSinceLastPromotion 3, # YearsWithCurrManager ]]) growth_score = model.predict(new_employee) print(f"Predicted Growth Score: {growth_score[0]:.2f} / 100") if growth_score[0] >= 75: print("Category: HIGH GROWTH potential") elif growth_score[0] >= 50: print("Category: MODERATE GROWTH potential") elif growth_score[0] >= 25: print("Category: LOW GROWTH potential") else: print("Category: AT RISK - needs development support")