Skip to content
Learning

Prevent employee attrition using machine learning

Exploring patterns in employee attrition

Workforce analytics can describe where retention questions merit further investigation. This example models recorded attrition from the supplied employee attributes and evaluates the resulting scores on held-out records.

1,470Source records
48Final input features
294Test observations
0.818Test ROC AUC

1. Business decision

Workforce planning benefits from understanding patterns in historical departures. A predictive association does not explain why an employee leaves or identify which intervention would change that outcome.

Historical patterns

Study the recorded attrition=Yes outcome.

Planning context

Interpret results alongside organizational and employment context.

Intervention evidence

Test proposed retention measures separately from the classifier.

People analyticsOrganizational researchHR planning
Do not use benchmark scores alone for employment decisions. Establish dataset provenance and representativeness, review privacy and sensitive attributes, validate across time and organizational units, and investigate group-level findings with human review. The model is not an estimate of an intervention's effect.

2. Data set

The supplied benchmark contains 1,470 employee records. The endpoint is attrition=Yes. The project provides a retrospective modelling exercise; it does not demonstrate that a particular workplace policy caused departures or will prevent them.

The saved Neural Designer project and report define the exact version used here. The project does not identify an independently verified external data record.

SubsetRecords
Training882
Validation / selection294
Testing294
Unused0
Inspect the full variable schema
VariableRoleTypeEncodingUnit
ageInputNumericAs supplied
business_travelInputNumericAs supplied
daily_rateInputNumericAs supplied
departmentInputCategoricalHuman Resources; Research & Development; SalesAs supplied
distance_from_homeInputNumericAs supplied
educationInputNumericAs supplied
education_fieldInputCategoricalHuman Resources; Life Sciences; Marketing; Medical; Other; Technical DegreeAs supplied
employee_countNoneConstantAs supplied
employee_numberInputNumericAs supplied
environment_satisfactionInputNumericAs supplied
genderInputBinaryFemale; MaleAs supplied
hourly_rateInputNumericAs supplied
job_involvementInputNumericAs supplied
job_levelInputNumericAs supplied
job_roleInputCategorical9 categories; see schemaAs supplied
job_satisfactionInputNumericAs supplied
marital_statusInputCategoricalDivorced; Married; SingleAs supplied
monthly_incomeInputNumericAs supplied
monthly_rateInputNumericAs supplied
num_companies_workedInputNumericAs supplied
over_18NoneConstantAs supplied
over_timeInputBinaryNo; YesAs supplied
percent_salary_hikeInputNumericAs supplied
performance_ratingInputNumericAs supplied
relationship_satisfactionInputNumericAs supplied
standard_hoursNoneConstantAs supplied
stock_option_levelInputNumericAs supplied
total_working_yearsInputNumericAs supplied
training_times_last_yearInputNumericAs supplied
work_life_balanceInputNumericAs supplied
years_at_companyInputNumericAs supplied
years_in_current_roleInputNumericAs supplied
years_since_last_promotionInputNumericAs supplied
years_with_curr_managerInputNumericAs supplied
attritionTargetBinaryNo; YesAs supplied

Interactive chart: attrition pie chart. Enable JavaScript to explore it.

attrition pie chart. Exported with Neural Designer from the saved task report.

Interactive chart: attrition Pearson correlations chart. Enable JavaScript to explore it.

attrition Pearson correlations chart. Exported with Neural Designer from the saved task report.
This is internal validation using the saved record-level split. Grouped or temporal independence has not been established.

3. Model

The final model has 48 encoded input features and 1 outputs. The following dimensions describe the final saved network.

LayerInput shapeOutput shapeActivation
Scaling4848—
Dense483Tanh
Dense31Sigmoid

Output semantics: the sigmoid score increases toward Yes; No is the other class. Calibration has not been evaluated, so scores are not presented as calibrated probabilities.

Exploring patterns in employee attrition: initial Neural Designer architecture
Architecture used for this model; no architecture-selection experiment is recorded. Diagram labels show original variables; categorical expansion and the numeric layer dimensions are documented in the model table.

4. Training strategy

The saved training configuration uses WeightedSquaredError with QuasiNewton. Training minimizes the recorded objective; the validation subset monitors generalization during fitting. The testing subset is used for the evaluation below.

Interactive chart: Quasi-Newton method error history. Enable JavaScript to explore it.

Quasi-Newton method error history. Exported with Neural Designer from the saved task report.

Quasi-Newton method results

MeasureValue
Epochs number120
Elapsed time00:00:00
Stopping criterionMaximum validation error increases
Training error0.353
Validation error0.467

5. Model selection

No model selection experiment is recorded in this supplied project. The displayed architecture is the trained model used for testing; earlier article claims about a different selected architecture do not apply to this version.

A transparent test-set comparator is the majority-class rule, with accuracy 85.7%. This is a baseline for interpretation, not an alternative model fitted on the test labels.

6. Testing analysis

The final classifier is evaluated on 294 testing records. The confusion counts below were reproduced from the saved model. Rows are actual classes and columns are predicted classes. The decision threshold is 0.5 on the score for Yes.

Test class prevalence is shown by the support counts. Accuracy is 79.6% and macro F1 is 0.66. ROC AUC is 0.818. The native ROC optimal threshold is descriptive of this test set and is not an independently validated operating policy.

Actual / predictedNoYesTotal
No21042252
Yes182442
ClassTest casesSensitivity / recallSpecificityPrecision / PPVF1
No25283.3%57.1%92.1%0.875
Yes4257.1%83.3%36.4%0.444

Interactive chart: ROC chart. Enable JavaScript to explore it.

ROC chart. Exported with Neural Designer from the saved task report.

Interactive chart: Cumulative gain chart. Enable JavaScript to explore it.

Cumulative gain chart. Exported with Neural Designer from the saved task report. This native curve is expressed in positive/negative rates. It is a discrimination view, not a validated fraction-of-customers campaign gain.

7. Model deployment

Validated inputs → saved preprocessing → neural network → score or estimate → domain review.

Explore the exported model

This research demonstration runs locally in your browser. Values outside the training range are outside the validated domain and are rejected. A valid input range does not guarantee that a combination is physically or operationally plausible.

This is a research demonstration, not a validated decision policy.

8. Evidence and limitations

Do not use benchmark scores alone for employment decisions. Establish dataset provenance and representativeness, review privacy and sensitive attributes, validate across time and organizational units, and investigate group-level findings with human review. The model is not an estimate of an intervention's effect.

No external validation or independent calibration study is included. Preprocessing statistics and model choices should be refitted within a prospective or grouped validation design. Correlations and directional responses describe associations, not causes. Human review is required before an operational decision.

Confidence intervals, subgroup performance, calibration curves and decision-cost validation are not established by these tasks. Predictive values apply to the observed test class distribution and may change when prevalence shifts.

References