# Data Analytics for Optimizing and Predicting Employee Performance
## 3 Methods and Results
### Evaluation  
As explained previously in this current research, multiple classification algorithms that provided the most optimal results for our business case were chosen, so that we could observe how each of these algorithms behaved. Through this process, one could not only see a comparison between them but could also conclude which of these algorithms should be used for further analysis in performance score estimation. In addition, the step of tuning the hyperparameters of the built models was also taken, to achieve even better results. Consequently, the research will again provide a comparison between the behavior of the chosen algorithms in three different states:  
* without having the hyperparameters tuned;
* with a classical way of tuning hyperparameters using grid search;
* by introducing Optuna, which is a framework specific to Python libraries that should provide an even better performance and results. Table 3 presents the results specifically regarding precision, recall, accuracy, and F1 score for all the combinations possible, obtained as described above. In the brief analysis conducted, the research evaluated all the models based on several key metrics: precision, recall, F1 Scores, and balanced accuracies. Precision is calculated as the number of true positives divided by the sum of true positives and false positives. It is a measure of a model's accuracy in predicting positive cases. The formula is as follows:  
\[\text{Precision}=\text{TP}/(\text{TP}+\text{FP}),\]  
where TP represents true positive cases and FP represents false positive cases. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Algorithm** & **Hyperparameter Tuning** & **Precision** & **Recall** & **Accuracy** & **F1 Score** \\ \hline \multirow{3}{*}{Decision trees} & No tuning & 75\% & 85\% & 85\% & 80\% \\  & Grid search & 91\% & 90\% & 90\% & 90\% \\  & Optuna & 94\% & 92\% & 92\% & 91\% \\ \hline \multirow{3}{*}{Random forest} & No tuning & 83\% & 89\% & 89\% & 85\% \\  & Grid search & 83\% & 89\% & 89\% & 85\% \\  & Optuna & 83\% & 89\% & 89\% & 85\% \\ \  
Recall assesses the model's ability to correctly identify all actual positives. The formula for recall is as follows:  
\[\text{Recall}=\text{TP}/(\text{TP}+\text{FN}),\]  
where TP stands for true positive cases and FN stands for false negative cases. Accuracy reflects the proportion of true results (both true positives and true negatives) among the total number of cases examined. The accuracy formula is as follows:  
\[\text{Accuracy}=(\text{TP}+\text{TN})/(\text{TP}+\text{FP}+\text{FN}+\text{ TN}),\]  
where TP is true positives, TN is true negatives, FP is false positives, and FN is false negatives [44]. While accuracy is commonly used to assess classification algorithms, it might not always be suitable, especially in cases of imbalanced class distribution. In contexts where minimizing false negatives holds significance, recall gains importance. Conversely, precision takes precedence when the goal is to minimize false positives. Moreover, the F1 score is introduced as a metric that combines precision and recall, offering a balanced assessment. This nuanced approach to model evaluation helps to ensure that the metrics chosen are aligned with the specific objectives and challenges of the classification task at hand [45]. \[\text{F1}=2\times(\text{Precision}+\text{Recall})/\text{Precision}\times\text{ Recall},\]  
where Precision and Recall are described above. By looking at each of these algorithms, one can immediately observe that decision trees and XGB obtained the best results in terms of performance, with F1 scores of approximately 91%. On the other hand, it can be concluded that KNN and ANN performed worst for our case study, with very low percentages for all the attributes reviewed above. Moreover, for decision trees, each type of hyperparameter tuning provided better and better results, resulting in Optuna obtaining the best scores.