# Machine Learning Approach for Personality Recognition in Spanish Texts
## 4 Results  
After we preprocessed the data and built the datasets, we proceeded to the evaluation of several classifier algorithms to build the predictive model of personality. In machine learning, classification refers to a predictive modeling problem where a class label is predicted for a given example of input data. A classifier algorithm finds relationships between unknown objects and a set of correctly labeled objects in order to classify the unknown objects [35]. There is an extensive range of classifier algorithms to be used based on the nature of data. Based on an analysis of recent work on machine learning proposals, the nature of the problem, and the data available, we decided to evaluate six of the most well-known classifiers: naive Bayes [11], sequential minimal optimization (support vector machines) [12], k-nearest neighbors [13], AdaBoost [14], J48 [15], and random forest [16]. A stratified ten times ten-fold cross-validation technique was used in the training and testing of the model, which is the standard when there is limited data [10]. We compared the statistical measures obtained by each one of the classifier algorithms to select the best predictive model. We evaluated the classifier algorithms within the nine datasets for the statistics measures: accuracy, precision, recall, F-measure, and receiver operating characteristic (ROC) area. \begin{table}
\begin{tabular}{l l} \hline \hline
**Classifier** & **Hyperparameters** \\ \hline Naive Bayes & Use a kernel estimator for numeric attributes = false (use a normal distribution) \\  & Number of instances to process with batch prediction = 100 \\ SMO & Kernel = polykernel \\ kNN & k = 5 \\  & Distance function = euclidean distance \\ AdaBoost & Classifier = random Forest \\  & Number of models to create = 10 \\ J48 & Pruning = true \\  & Minimum number of instances per leaf = 2 \\ Random & Number of features to consider in each split = int (log\_2 (\#predictors) + 1) \\ Forest & Percentage of the raw training dataset = 100 \\  & Number of bags = 100 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Hyperparameter optimization of classification algorithms. Specifically, we focus on F-measure and ROC area. We are interested in F-measure because we want to have a balance between precision and recall. Precision is the fraction of relevant instances among the retrieved instances, while recall is the fraction of relevant instances that have been retrieved over the total amount of relevant instances [36]. The ROC curve is used for the visual comparison of classification models, which shows the tradeoff between the true positive rate and the false positive rate. The area under the ROC curve is a measure of the accuracy of the model. When a model is closer to the diagonal, it is less accurate, and the model with perfect accuracy will have an area of 1.0 [36]. Figure 3 presents the results of the six classifiers within the nine datasets for the five measures. Table 8 depicts the best classifier for each dataset according to F-measure. The best classifier for each dataset according to ROC area is presented in Table 9. Table 10 presents the ten classifiers that have the best performance based on F-measure. Table 11 presents the ten classifiers that have the best performance according to ROC area. Figure 3: Performance of classifiers in the nine datasets: (**a**) Original dataset; (**b**) without the 100 least correlated features with the class; (**c**) without the 150 least correlated features with the class; (**d**) without the 200 least correlated features with the class; (**e**) without the 271 least correlated features with the class; (**f**) without the 100 least informative features; (**g**) without the 150 least informative features; (**h**) without the 200 least informative features; (**i**) without the 265 least informative features. Table 8 and 9 show that AdaBoost and random forest are the classifiers with the best performance for most datasets according to F-measure and ROC area.