Fig. 1.1
Fig. 1.2
Fig. 1.3
Fig. 1.4
Fig. 1.5
Fig. 1.6
Fig. 1.7
## k-Nearest Neighbors
##
## 32 samples
## 9 predictor
## 2 classes: 'Unsatisfied', 'Satisfied'
##
## No pre-processing
## Resampling: Cross-Validated (10 fold, repeated 3 times)
## Summary of sample sizes: 29, 29, 28, 29, 29, 28, ...
## Resampling results across tuning parameters:
##
## k Accuracy Kappa
## 5 0.8972222 0.7566667
## 7 0.7833333 0.4900000
## 9 0.6833333 0.2900000
##
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 5.
| department | years | ideas | communication | recognition | training | conditions | tools | balance | satisfaction | prediction |
|---|---|---|---|---|---|---|---|---|---|---|
| Administrative | 16 | 2 | 3 | 2 | 2 | 4 | 5 | 2 | Unsatisfied | Unsatisfied |
| Administrative | 2 | 4 | 4 | 3 | 4 | 4 | 5 | 3 | Satisfied | Satisfied |
| Administrative | 14 | 4 | 3 | 2 | 2 | 5 | 5 | 5 | Unsatisfied | Satisfied |
| Maintenance | 17 | 5 | 4 | 3 | 5 | 5 | 5 | 3 | Satisfied | Satisfied |
| Maintenance | 15 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | Satisfied | Satisfied |
| Management | 1 | 5 | 4 | 4 | 3 | 5 | 3 | 5 | Satisfied | Satisfied |
| Management | 3 | 3 | 4 | 3 | 3 | 4 | 5 | 5 | Satisfied | Satisfied |
| Management | 3 | 2 | 2 | 2 | 2 | 3 | 5 | 3 | Unsatisfied | Unsatisfied |
| Production | 16 | 2 | 3 | 2 | 4 | 4 | 4 | 2 | Unsatisfied | Unsatisfied |
| Production | 15 | 2 | 3 | 1 | 4 | 4 | 4 | 2 | Unsatisfied | Unsatisfied |
| Production | 13 | 3 | 3 | 3 | 4 | 4 | 4 | 3 | Satisfied | Satisfied |
| Production | 3 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | Satisfied | Satisfied |
| Production | 6 | 2 | 2 | 1 | 3 | 3 | 4 | 2 | Unsatisfied | Unsatisfied |
| Production | 1 | 5 | 4 | 4 | 3 | 4 | 5 | 5 | Satisfied | Satisfied |
| Production | 3 | 3 | 4 | 3 | 4 | 5 | 5 | 4 | Satisfied | Satisfied |
| Production | 2 | 4 | 4 | 4 | 4 | 5 | 5 | 5 | Satisfied | Satisfied |
| Production | 3 | 3 | 4 | 3 | 3 | 2 | 4 | 4 | Unsatisfied | Unsatisfied |
| Production | 2 | 4 | 3 | 4 | 3 | 3 | 4 | 4 | Unsatisfied | Satisfied |
| Production | 2 | 4 | 5 | 4 | 4 | 4 | 4 | 4 | Satisfied | Satisfied |
| Production | 15 | 5 | 4 | 3 | 4 | 3 | 5 | 3 | Satisfied | Satisfied |
| Production | 5 | 4 | 5 | 3 | 2 | 3 | 5 | 4 | Satisfied | Satisfied |
| Production | 8 | 5 | 5 | 3 | 5 | 3 | 5 | 3 | Satisfied | Satisfied |
| Production | 17 | 4 | 3 | 4 | 3 | 3 | 5 | 2 | Unsatisfied | Unsatisfied |
| Production | 15 | 5 | 3 | 4 | 5 | 5 | 5 | 5 | Satisfied | Satisfied |
| Production | 5 | 2 | 4 | 2 | 2 | 2 | 5 | 3 | Unsatisfied | Unsatisfied |
| QC | 1 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | Satisfied | Satisfied |
| QC | 11 | 3 | 4 | 4 | 4 | 5 | 5 | 2 | Satisfied | Satisfied |
| SR | 21 | 3 | 2 | 2 | 3 | 2 | 4 | 3 | Unsatisfied | Unsatisfied |
| SR | 8 | 3 | 2 | 2 | 2 | 2 | 4 | 2 | Unsatisfied | Unsatisfied |
| SR | 32 | 2 | 3 | 2 | 4 | 2 | 5 | 3 | Unsatisfied | Unsatisfied |
| SR | 2 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | Satisfied | Satisfied |
| SR | 18 | 4 | 4 | 4 | 5 | 5 | 5 | 5 | Satisfied | Satisfied |
## Confusion Matrix and Statistics
##
## Reference
## Prediction Unsatisfied Satisfied
## Unsatisfied 11 0
## Satisfied 2 19
##
## Accuracy : 0.9375
## 95% CI : (0.7919, 0.9923)
## No Information Rate : 0.5938
## P-Value [Acc > NIR] : 1.452e-05
##
## Kappa : 0.8672
##
## Mcnemar's Test P-Value : 0.4795
##
## Sensitivity : 1.0000
## Specificity : 0.8462
## Pos Pred Value : 0.9048
## Neg Pred Value : 1.0000
## Prevalence : 0.5938
## Detection Rate : 0.5938
## Detection Prevalence : 0.6562
## Balanced Accuracy : 0.9231
##
## 'Positive' Class : Satisfied
##
| department | years | ideas | communication | recognition | training | conditions | tools | balance | satisfaction | Unsatisfied | Satisfied | pred.class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Administrative | Hired within last 4 years | 2 | 3 | 2 | 2 | 4 | 5 | 2 | Unsatisfied | 1.0000000 | 0.0000000 | Unsatisfied |
| Administrative | Hired more than 4 years ago | 4 | 4 | 3 | 4 | 4 | 5 | 3 | Satisfied | 0.0142491 | 0.9857509 | Satisfied |
| Administrative | Hired within last 4 years | 4 | 3 | 2 | 2 | 5 | 5 | 5 | Unsatisfied | 0.9985680 | 0.0014320 | Unsatisfied |
| Maintenance | Hired within last 4 years | 5 | 4 | 3 | 5 | 5 | 5 | 3 | Satisfied | 0.0000000 | 1.0000000 | Satisfied |
| Maintenance | Hired within last 4 years | 5 | 5 | 5 | 5 | 5 | 5 | 5 | Satisfied | 0.0000000 | 1.0000000 | Satisfied |
| Management | Hired more than 4 years ago | 5 | 4 | 4 | 3 | 5 | 3 | 5 | Satisfied | 0.0000000 | 1.0000000 | Satisfied |
| Management | Hired more than 4 years ago | 3 | 4 | 3 | 3 | 4 | 5 | 5 | Satisfied | 0.0021911 | 0.9978089 | Satisfied |
| Management | Hired more than 4 years ago | 2 | 2 | 2 | 2 | 3 | 5 | 3 | Unsatisfied | 1.0000000 | 0.0000000 | Unsatisfied |
| Production | Hired within last 4 years | 2 | 3 | 2 | 4 | 4 | 4 | 2 | Unsatisfied | 1.0000000 | 0.0000000 | Unsatisfied |
| Production | Hired within last 4 years | 2 | 3 | 1 | 4 | 4 | 4 | 2 | Unsatisfied | 0.9999999 | 0.0000001 | Unsatisfied |
| Production | Hired within last 4 years | 3 | 3 | 3 | 4 | 4 | 4 | 3 | Satisfied | 0.7927756 | 0.2072244 | Unsatisfied |
| Production | Hired more than 4 years ago | 5 | 5 | 5 | 5 | 5 | 5 | 5 | Satisfied | 0.0000000 | 1.0000000 | Satisfied |
| Production | Hired within last 4 years | 2 | 2 | 1 | 3 | 3 | 4 | 2 | Unsatisfied | 1.0000000 | 0.0000000 | Unsatisfied |
| Production | Hired more than 4 years ago | 5 | 4 | 4 | 3 | 4 | 5 | 5 | Satisfied | 0.0000122 | 0.9999878 | Satisfied |
| Production | Hired more than 4 years ago | 3 | 4 | 3 | 4 | 5 | 5 | 4 | Satisfied | 0.0007979 | 0.9992021 | Satisfied |
| Production | Hired more than 4 years ago | 4 | 4 | 4 | 4 | 5 | 5 | 5 | Satisfied | 0.0002190 | 0.9997810 | Satisfied |
| Production | Hired more than 4 years ago | 3 | 4 | 3 | 3 | 2 | 4 | 4 | Unsatisfied | 0.9882210 | 0.0117790 | Unsatisfied |
| Production | Hired more than 4 years ago | 4 | 3 | 4 | 3 | 3 | 4 | 4 | Unsatisfied | 0.9315183 | 0.0684817 | Unsatisfied |
| Production | Hired more than 4 years ago | 4 | 5 | 4 | 4 | 4 | 4 | 4 | Satisfied | 0.0008345 | 0.9991655 | Satisfied |
| Production | Hired within last 4 years | 5 | 4 | 3 | 4 | 3 | 5 | 3 | Satisfied | 0.0000902 | 0.9999098 | Satisfied |
| Production | Hired within last 4 years | 4 | 5 | 3 | 2 | 3 | 5 | 4 | Satisfied | 0.0037451 | 0.9962549 | Satisfied |
| Production | Hired within last 4 years | 5 | 5 | 3 | 5 | 3 | 5 | 3 | Satisfied | 0.0000000 | 1.0000000 | Satisfied |
| Production | Hired within last 4 years | 4 | 3 | 4 | 3 | 3 | 5 | 2 | Unsatisfied | 0.9798306 | 0.0201694 | Unsatisfied |
| Production | Hired within last 4 years | 5 | 3 | 4 | 5 | 5 | 5 | 5 | Satisfied | 0.0000001 | 0.9999999 | Satisfied |
| Production | Hired within last 4 years | 2 | 4 | 2 | 2 | 2 | 5 | 3 | Unsatisfied | 1.0000000 | 0.0000000 | Unsatisfied |
| QC | Hired more than 4 years ago | 5 | 5 | 5 | 5 | 5 | 5 | 5 | Satisfied | 0.0000000 | 1.0000000 | Satisfied |
| QC | Hired within last 4 years | 3 | 4 | 4 | 4 | 5 | 5 | 2 | Satisfied | 0.0005646 | 0.9994354 | Satisfied |
| SR | Hired within last 4 years | 3 | 2 | 2 | 3 | 2 | 4 | 3 | Unsatisfied | 1.0000000 | 0.0000000 | Unsatisfied |
| SR | Hired within last 4 years | 3 | 2 | 2 | 2 | 2 | 4 | 2 | Unsatisfied | 1.0000000 | 0.0000000 | Unsatisfied |
| SR | Hired within last 4 years | 2 | 3 | 2 | 4 | 2 | 5 | 3 | Unsatisfied | 1.0000000 | 0.0000000 | Unsatisfied |
| SR | Hired more than 4 years ago | 5 | 5 | 5 | 5 | 5 | 5 | 5 | Satisfied | 0.0000000 | 1.0000000 | Satisfied |
| SR | Hired within last 4 years | 4 | 4 | 4 | 5 | 5 | 5 | 5 | Satisfied | 0.0000066 | 0.9999934 | Satisfied |
## Confusion Matrix and Statistics
##
## Reference
## Prediction Unsatisfied Satisfied
## Unsatisfied 13 1
## Satisfied 0 18
##
## Accuracy : 0.9688
## 95% CI : (0.8378, 0.9992)
## No Information Rate : 0.5938
## P-Value [Acc > NIR] : 1.303e-06
##
## Kappa : 0.936
##
## Mcnemar's Test P-Value : 1
##
## Sensitivity : 0.9474
## Specificity : 1.0000
## Pos Pred Value : 1.0000
## Neg Pred Value : 0.9286
## Prevalence : 0.5938
## Detection Rate : 0.5625
## Detection Prevalence : 0.5625
## Balanced Accuracy : 0.9737
##
## 'Positive' Class : Satisfied
##