Application of machine learning techniques for obesity prediction: a comparative study

. Obesity, characterized by excess adipose tissue, is becoming a major public health problem. This condition, caused primarily by unbalanced energy intake (overconsumption) and exacerbated by modern lifestyles such as physical inactivity and suboptimal dietary habits, is the harbinger of a variety of health disorders such as diabetes, cardiovascular disease, and certain cancers. Therefore, there is an urgent need to accurately diagnose and assess the extent of obesity in order to formulate and apply appropriate preventive measures and therapeutic interventions. However, the heterogeneous results of existing diagnostic techniques have triggered a fierce debate on the optimal approach to identifying and assessing obesity, thus complicating the search for a standard diagnostic and treatment method. This research primarily aims to use machine learning techniques to build a robust predictive model for identifying overweight or obese individuals. The proposed model, derived from a person's physical characteristics and dietary habits, was evaluated using a number of machine learning algorithms, including Multilayer Perceptron (MLP), Support Vector Machine (SVM), Fuzzy K-Nearest Neighbors (FuzzyNN), Fuzzy Unordered Rule Induction Algorithm (FURIA), Rough Sets (RS), Random Tree (RT), Random Forest (RF), Naive Bayes (NB), Logistic Regression (LR), and Decision Table (DT). Subsequently, the developed models were evaluated using a number of evaluation measures such as correlation coefficient, accuracy, kappa statistic, mean absolute error, and mean square error. The hyperparameters of the model were properly calibrated to improve accuracy. The study revealed that the random forest model (RF) had the highest accuracy of 95.78 %, closely followed by the logistic regression model (LR) with 95.22 %. Other algorithms also produced satisfactory accuracy results but could not compete with the RF and LR models. This study suggests that the pragmatic application of the model could help physicians identify overweight or obese individuals and thus accelerate the early detection, prevention, and treatment of obesity-related diseases.


Introduction
The World Health Organization (WHO) defines overweight and obesity as conditions characterized by abnormal or excessive fat accumulation in the human body with the potential to negatively affect a person's overall health.A common measure used to assess these conditions is the Body Mass Index (BMI), a calculated value derived by dividing a person's weight (in kilograms) by the square of their height (in meters).A BMI of 25 or more is considered an indication of obesity, while a BMI of over 30 is considered obese.Obesity is a major public health problem and is associated with increased susceptibility to a number of health complications, including diabetes, cardiovascular disease, and certain cancers [1].
Obesity is a complex condition due to a number of factors, the most important of which is a mismatch between energy intake and energy expenditure.This mismatch affects numerous metabolic pathways, culminating in overactive adipogenesis and the subsequent accumulation of excess energy in the form of triglycerides.At the same time, other factors such as suboptimal nutrition, insulin resistance, systemic inflammation, and genetic predispositions play an important role in the development of obesity [2]- [7].
Genetic predisposition to obesity is a complex trait that affects both the human genome and the metagenomes of the microbiota that inhabit the human body.Certain genetic variations have been found to affect energy metabolism and appetite regulation, causing an imbalance between energy intake and consumption that eventually leads to obesity.In addition, there is growing evidence of the crucial role of the gut microbiome in the development of obesity, as certain bacterial strains have been linked to alterations in metabolism, inflammation, and appetite regulation, possibly contributing to the development of obesity [2], [8].
Despite the role played by genetic susceptibility to obesity, there is consensus in the scientific community that environmental factors are the main cause of today's obesity epidemic.Influences such as dietary habits, physical activity levels, and a sedentary lifestyle are important factors contributing to obesity.In addition, the gut microbiome, which responds to changes in diet and environment, has been shown to play a critical role in the development of obesity, particularly in adults.Although the composition of the gut microbiota is regulated at the genetic level, it can be significantly modulated by environmental variables such as diet.Numerous studies have found that diets high in fat, carbohydrates, and energy are major contributors to the global prevalence of obesity [9]- [11].
Currently, clinical strategies for the management of obesity focus primarily on alleviating the complications and comorbidities associated with this condition.These strategies usually involve a holistic approach of dietary modification, behavior change, and increased physical activity to facilitate weight loss and improve overall health.A common approach is to restrict calorie intake, often in conjunction with increased physical activity, to achieve a negative energy balance.Lifestyle changes, which include stress management, adequate sleep, and increased physical activity, are often recommended as part of a comprehensive treatment plan.In more severe cases where conventional measures prove ineffective, pharmaceutical options and bariatric surgery may be considered a last resort.The main goal of clinical interventions is to improve overall health and reduce the risks associated with obesity-related complications [12,13].
Obesity is a major public health challenge as it is associated with a number of diseases such as diabetes, cardiovascular disease, and certain cancers.Body Mass Index (BMI), a calculation of a person's weight in kilograms divided by the square of their height in meters, is the predominant tool used to diagnose obesity.People with a BMI of more than 30 kg/m2 are classified as obese, while people with a BMI of more than 25 kg/m2 are considered overweight.Although BMI is widely used because of its simplicity and cost-effectiveness, it also has its limitations, particularly because it is unable to account for differences in muscle mass, bone density, and fat distribution.Therefore, additional methods such as skinfold thickness measurement, bioelectrical impedance, and dual-energy X-ray absorptiometry (DXA) are used to assess body fat and muscle mass [15].
BMI is routinely used as a preliminary and practical tool to detect obesity.According to the World Health Organization guidelines (WHO), a BMI above 25 is considered overweight, and a value above 30 is considered obese.However, recent studies show that the risk of chronic diseases in the population increases with a BMI value of 21.It is also known that the gut microbiota has a significant impact on metabolic health.Obesity is associated with numerous metabolic disorders, including type 2 diabetes, non-alcoholic fatty liver disease, cardiovascular disease, and malnutrition.Therefore, when assessing obesity and its associated health risks, it is critical to consider factors such as gut microbiota, body composition, and metabolic markers in addition to BMI [15]- [18].
Individuals who are classified as overweight or obese are at increased risk for numerous chronic diseases, including type 2 diabetes, cardiovascular disease, certain cancers, and sleep apnea.In addition, obesity can exacerbate conditions such as joint pain, osteoarthritis, and psychological problems such as depression and low self-esteem.Therefore, treating obesity is important not only for aesthetic reasons but also for overall health and well-being [16], [19].
Obesity is associated with an extensive range of chronic health ailments.Among these are: -Type 2 diabetes: The risk of type 2 diabetes is heightened by obesity due to an increase in insulin resistance and a decrease in insulin sensitivity.
-Hypertension: Obesity serves as a prominent risk factor for hypertension, as excess weight burdens the heart and blood vessels, leading to elevated blood pressure.
-Cardiovascular disease: The probability of experiencing heart disease, stroke, and other cardiovascular conditions is amplified with obesity.
-Osteoarthritis: The extra strain placed on joints, particularly hips and knees due to obesity, often precipitates osteoarthritis.
-Depression: The probability of depression is amplified in the context of obesity, likely attributed to the physical and emotional repercussions of being overweight.
-Alzheimer's disease: An increased risk of developing Alzheimer's disease and other types of dementia is associated with obesity.
-Cancer: Obesity elevates the risk for several forms of cancer, including but not limited to breast, prostate, kidney, ovarian, liver, and colon cancer.It is essential to underscore that the health risks mentioned are merely representative of the numerous potential complications associated with obesity.As a result, the treatment and management of obesity are of paramount importance to mitigate the risk of these and other chronic health conditions [1], [7].
Efforts to prevent obesity require a holistic approach that encourages a healthy lifestyle, characterized by habitual physical activity and a balanced diet.Public policies, health education, and initiatives to promote health play an instrumental role in tackling the obesity problem.The precise determination of an individual's obesity severity is crucial for accurate diagnosis and personalized treatment.Machine learning emerges as a potent tool in this context, possessing the capability to predict individuals who could profit from specific diets or interventions.Machine learning algorithms are designed to distil information from data, and numerous research articles have attested to their efficacy in predicting and managing obesity [20]- [22].
Machine learning houses a repertoire of advanced algorithms proficient in analyzing and extracting information from extensive datasets.These algorithms can classify, fit, learn, predict, and analyze data, thereby enriching our understanding of obesity and our predictive capabilities.Machine learning algorithms are capable of identifying patterns and trends in data that may be complex or impossible for humans to discern, paving the way for early diagnosis, treatment, and management of obesity.Machine learning can also be leveraged to predict future outcomes, such as the likelihood of developing obesity-related health issues, aiding healthcare professionals in devising more effective interventions.Overall, machine learning has the potential to significantly enhance our understanding of obesity and contribute to the advancement of more efficacious prevention and treatment strategies [20], [23]- [25].
The healthcare sector has seen an upsurge of interest in the application of machine learning in recent years [27].The aim of this study is to construct a predictive model employing machine learning techniques to swiftly identify and assess overweight or obese individuals.This model will be developed based on data pertaining to physical conditions and dietary habits, predicting an individual's likelihood of being obese and the severity of their obesity.This tool could prove advantageous for healthcare professionals in the early detection and intervention of obesity.The integration of machine learning in healthcare could enhance diagnostic and treatment outcomes, providing a more efficient approach for analyzing and interpreting voluminous data [28], [29].
This study is structured into various sections to present a lucid account of the research process and findings.Chapter 2 provides an overview of the experimental procedures, methodologies, and strategies utilized throughout the study, including data collection and pre-processing, the implemented machine learning algorithms, and the evaluation metrics employed.Chapter 3 elucidates the results achieved using the proposed machine learning classifiers, along with their performance and accuracy.Chapter 4 summarizes the research, emphasizing the main conclusions and recommendations for future work.

Materials and methods
The main goal of this study is to use machine learning methods to determine a person's level of obesity based on their dietary habits and physical condition in order to create personalized treatment plans for patients.In this research project, body mass index (BMI) is used as a determinant of obesity, which is then classified into different categories such as underweight, normal weight, overweight level I, overweight level II, obese type I, obese type II, and obese type III.This classification is based on equation (1) and follows the criteria of the World Health Organization (WHO) and the Mexican normative guidelines.Table 1 shows a comprehensive classification of BMI according to the WHO and the Mexican normative guidelines.The aim of this study is to develop a predictive model capable of accurately classifying individuals into these specified obesity categories, which could potentially aid in the early detection and intervention of obesity [28]: This study follows a structured methodology that can be explained in the following order: 1) Data collection: this involves compiling relevant information on the physical characteristics and dietary preferences of participants within a given population.
2) Data refinement: This phase involves the careful refinement of the collected data to eliminate missing or incongruent values, the calculation of the body mass index (BMI) for each person, and the classification of participants into different obesity strata according to World Health Organization (WHO) criteria and Mexican normative guidelines.
4) Performance evaluation of the models: the resulting models are then examined using a number of performance indices such as Correlation Coefficient, Accuracy (ACC), Kappa Statistic (KS), Mean Absolute Error (MAE), Root Mean Square Error (RMSE) and Complexity Matrix.
5) Results and findings: This section explains the main findings of the study, especially with regard to the effectiveness of the different machine learning algorithms used.
6) Concluding remarks: This concluding section summarizes the main conclusions of the study and suggests possible future research in this area.

Dataset
The dataset used in this study [28] contains information that allows the degree of obesity of an individual to be assessed based on their dietary habits and physical condition.The dataset includes 2111 instances (rows) and 17 variables (columns) consisting of numeric, binary, and categorical input variables.A single target or outcome variable provides data on a person's level of obesity.This data set, referred to as "NObesity", includes the following classifications: Underweight, Normal Weight, Obesity Level I, Obesity Level II, Obesity Type I, Obesity Type II, and Obesity Type III.Table 2 provides a comprehensive overview of the data variables and includes variable names, data types, and precise definitions.The dataset is used to train and evaluate the machine learning models developed in this study to predict the level of obesity in individuals.
Each model input integrates a unique set of patient information along with a specific target variable.Input variables used in the model include demographic information, anthropometric measurements, and data on dietary habits and physical exertion.Fig. 1 shows the data distribution used to estimate a person's level of obesity based on their dietary habits and physical condition.This visualization illustrates the different contributions of each input variable to the prediction of the target variable, namely the level of obesity.It facilitates understanding of the relationship between the input variables and the target variable, as well as the relative importance of each variable in the prediction process.In addition, the figure shows the distribution of the data for each input variable, which can prove helpful in identifying the distribution of the data and any anomalies or patterns.

Machine learning algorithms
Machine learning (ML) is a rapidly advancing discipline that has attracted much attention in recent years.It involves the systematic study of algorithms and statistical models used by computer systems to perform tasks without the need for explicit programming.The ultimate goal of machine learning is to equip computers with the ability to use data more resourcefully and efficiently through a process known as reinforcement learning.This method allows computers to learn from data and incrementally improve their performance.Tools have always been used to perform a range of tasks more efficiently.With the increase in available data, the need for machine learning is becoming more acute.Machine learning is used to gain insights from vast amounts of data when traditional methods prove insufficient to decipher the information contained in the data.The development of autonomous learning robots that do not need to be explicitly programmed is a focus of current research.This could allow robots to adapt to variable environments and perform tasks more efficiently and effectively.Machine learning is used in a variety of sectors, including healthcare, finance, transportation, and manufacturing.It has the potential to revolutionize the way we live and work and offers ample opportunities for innovation and growth [21].The concept of "supervised learning classification" refers to the process of machine learning, where computer software is trained on a labeled data set, meaning that each input is assigned the correct output or class.The software then uses this training data to make predictions for new, unseen data.The goal of classification is to assign new observations to one of several predefined categories or classes.A variety of classification models can be used, such as decision trees, random forests, Naive Bayes, Support Vector machines, and logistic regression.Each model has its own strengths and weaknesses, and the choice of an appropriate model depends on the nature of the problem and the characteristics of the data.Classification techniques have applications in many fields, such as natural language processing, image recognition, and bioinformatics.They are also used in areas such as healthcare, finance, marketing, and customer relationship management.The purpose of classification is to divide large amounts of data into smaller groups based on common characteristics so that they are easier to understand and analyze.The classification model, which is similar to the regression model, predicts future outcomes and serves as an important method for examining data in various fields.

Multi-layer perceptron (MLP)
A multilayer perceptron (MLP) [30], [31], is a subset of feedforward artificial neural networks commonly used in supervised learning tasks such as classification and regression.The MLP consists of three main layers: an input layer, an output layer, and one or more hidden layers in between.The input layer primarily receives and processes input data, which is then passed through the network to the output layer.The output layer is responsible for producing the final prediction or output in response to the processed input data.The hidden layers, which lie between the input and output layers, contain neurons that perform computational tasks.
In the context of an MLP, the neurons are connected by weighted connections and use a nonlinear activation function to process the incoming data.These connection weights are adjusted during the training phase to optimize the operational performance of the network.This process of changing the weights, called backpropagation, works like a supervised learning algorithm that applies gradient descent to minimize the error between predicted and actual output.MLPs are ideal for solving nonlinear problems because they can approximate any continuous function.They are used in a variety of fields, such as image recognition, natural language processing, and speech recognition [30][31][32][33].The graphical user interface (GUI) of this classification algorithm, implemented with the software Weka, is shown in Fig. 2.

Support vector machine (SVM)
Support Vector Machines (SVMs) [35] are a type of supervised learning algorithm commonly used for classification tasks.SVMs work by creating a boundary, called a "hyperplane", that separates different classes of data points in a high-dimensional feature space.The primary goal of SVMs is to create a boundary that maximizes the distance from itself to the nearest data points in each class, providing an optimally separated hyperplane.SVMs are particularly effective in dealing with complicated and small to medium-sized data sets and are ideal for situations where the data is not linearly separable, i.e., cannot be divided by a single straight line.
For such scenarios, SVMs use a strategy called the kernel trick, which projects the data into a higher-dimensional space to facilitate linear separation.SVMs are used in a variety of machine learning domains, such as text classification, image classification, and bioinformatics.They have a solid theoretical foundation and have achieved exceptional experimental results.Since they are suitable for both classification and regression tasks, SVMs show high efficiency in processing linear and nonlinear data [34]- [36].

Fuzzy K-nearest neighbors (FuzzyNN)
The Fuzzy K-Nearest Neighbors (FKNN) algorithm is an adaptation of the traditional K-Nearest Neighbors (KNN) algorithm, an instance-based learning approach.FKNN uniquely integrates fuzzy logic with KNN to provide classification predictions.The main difference between FKNN and standard KNN is that FKNN uses a portion of the available samples in its architecture for predictions rather than the entire dataset.
This method of "instance-based learning" facilitates classification predictions by using a subset of samples within the FKNN structure.As a result, the algorithm requires less memory because it does not retain an array of abstractions distilled from specific instances.To alleviate this situation, the closest-neighbor algorithm has been improved.
The goal of this project is to prove that the memory requirements of FKNN can be significantly reduced while keeping the learning rate and classification accuracy as close as possible to their original values.This can be achieved by using a fraction of the accessible samples within the structure and applying fuzzy logic for predictions [37,38].

Fuzzy unordered rule induction algorithm (FURIA)
The Fuzzy Unordered Rule Inductive Algorithm (FURIA) is an innovative algorithm for rule-based fuzzy classification that uses unordered rule sets for decision-making, unlike conventional rule lists.This relatively new advance in rule-based fuzzy classification offers several advantages over traditional methods [39].
One outstanding advantage of FURIA is its ability to generate concise and manageable rule sets, thus facilitating the interpretation and understanding of classification results.By using fuzzy rules and unordered rule sets instead of conventional rule lists, FURIA is able to take into account situations that might otherwise be overlooked.In addition, FURIA uses an optimal rule expansion mechanism that allows it to adapt to new circumstances and thereby improve classification accuracy.
Compared to other classifiers, such as the original RIPPER and C4.5, FURIA has shown a remarkable improvement in classification accuracy on test data.Consequently, FURIA proves to be an excellent tool for classification tasks with potential applications in various fields such as image recognition, natural language processing, and speech recognition [40], [41].

Rough sets (RS)
Rough sets (RS) are a mathematical framework for data processing and mining, a concept originally developed by Pawlak in the 1980s [42].This pioneering approach extends traditional set theory by allowing the formulation of complex concepts that would otherwise be difficult to understand using standard reasoning paradigms.In rough set theory, a subset within a universal set is typified by ordered pairs of subsets and supersets belonging to the universal set itself.
An essential notion introduced by rough set theory is the concept of "approximate sets", which derives from the equivalence between two different numerical sets.These approximate sets are further divided into upper and lower sets constructed using equivalence classes.These sets consist of the union of all equivalence classes that serve as subsets of a given set.
Rough sets have applications in various fields, including data mining, knowledge discovery, and decision-making.The ability to deal with the uncertainty and imprecision of data makes rough sets particularly advantageous in dealing with incomplete or inconsistent information.Furthermore, rough set theory underpins the theory of complete sets and has been instrumental in the development of novel algebraic structures [43,44].

Random tree (RT)
Random Tree (RT) [46] is a methodological approach used in ensemble learning and is often used to tackle complex tasks in classification, regression, and similar domains.As a supervised classifier, it cultivates a large number of decision trees in the training phase, which are subsequently used to predict the class of new instances.Random trees are an example of a unique facet of ensemble learning, where numerous individual decision trees are cultivated and combined into a "random forest", a collective of tree-based predictors.
This method proves particularly beneficial when processing high-dimensional and complex datasets, as it prevents overfitting and strengthens the generalization ability of the model.A key feature of random trees is that they combine the principles of single-model trees and random trees.In model trees, each leaf node is connected to a linear model that is optimized for the local subspace.In contrast, in random trees, the features and data samples are randomly selected during tree construction.
The ability to transform imbalanced trees into balanced trees through the use of random trees can greatly improve the precision and robustness of the model [47,48].

Random forest (RF)
Random Forest is an ensemble learning technique that groups numerous decision trees together to solve different problems.In this paradigm, each tree is trained on a unique random subset of the data, and the matching decision or common value of these trees determines the output of the Random Forest.This method is particularly well suited for high-dimensional and complex datasets, as it prevents overfitting and improves the generalization performance of the model.
Training the individual trees on different random subsets of data helps to reduce the correlation between the trees and increase the diversity of the ensemble.This strategy, often referred to as "bagging" (or "bootstrap aggregation") of decision trees, involves cultivating a comprehensive set of related trees to solve a given problem.In addition, the Random Forest algorithm includes a randomization element where each tree falls back on the values of an independently generated random vector.This feature increases the robustness of the model and provides protection against overfitting [46], [49], and [50].

Naive Bayes (NB)
Naive Bayes is a simplified learning method that goes back to Thomas Bayes [51].It uses Bayes' theorem and assumes robust conditional independence of features with respect to class.Although the independence assumption is not always satisfied in practical scenarios, Naive Bayes continues to be widely used due to its computational efficiency and other commendable properties.
The method works under the assumption that the characteristics used to estimate the value are independent of the value being estimated.Consider the case where the species of a fish is to be determined from its length and weight.In this context, the weight of a fish belonging to a particular species is usually dependent on its length and vice versa, possibly contradicting the assumption of independence.However, studies have shown that the independence assumption imposes fewer constraints on classification tasks involving categorical estimation than previously thought.In certain cases, unbiased Bayesian learning has led to lower error rates compared to more complicated learning strategies, such as the construction of univariate decision trees [52].
The quantitative component of a Bayesian network comprises three main elements: Probability theory, Bayes' theorem, and conditional probability functions.Bayes' theorem is based on the idea that the conditional probability is proportional to the probability of an event occurring.This allows graphical models to conveniently represent probability distributions as conditional dependencies or independencies [53,54].

Logistic regression (LR)
Logistic regression (LR) is a statistical method and supervised machine learning algorithm designed for analyzing and modeling the relationship between a binary or categorical dependent variable and one or more independent variables, typically manifested as continuous or categorical predictors.LR is often used for binary classification problems where the dependent variable has two potential outcomes or classes, such as success or failure, positive or negative, or the presence or absence of a particular condition.
The logistic regression model calculates the probability that the dependent variable can be assigned to a particular class depending on the values of the independent variables.The model uses the logistic function, also known as the sigmoid function, to convert linear combinations of predictors into probabilities that vary between 0 and 1.The model then applies these probabilities to make class predictions, using a threshold, usually 0.5, to determine the final class assignment.
The simplicity, interpretability, and ease of implementation of logistic regression contribute to its widespread use in various applications, such as medical diagnosis, customer loyalty prediction, and sentiment analysis.Moreover, logistic regression is less prone to overfitting compared to more complex machine learning models, especially when combined with regularization techniques such as L1 or L2 regularization.However, logistic regression requires a linear relationship between the logit of probabilities and the independent variables, a condition that is not always met in practice [55]-[58].

Decision table (DT)
Decision tables are a powerful tool for analyzing and understanding complex decision-making processes.They provide a structured and systematic representation of the relationships between different variables and the corresponding actions to be taken based on those variables.This makes decision tables particularly valuable in fields such as economics, finance, and computer programming, where effective decision-making plays a central role.
In addition, decision tables can be used to develop decision-making software and systems that automate the decision-making process according to the rules specified in the table.This streamlined approach increases the efficiency and consistency of decision-making across different applications and industries and enables more effective and reliable decision outcomes [59,60].

Results
The results of the study show that the Random Forest (RF) classifier had the best performance in terms of accuracy, with a result of 95.78 %.The Logistic Regression (LR) classifier had the second-best performance with a result of 95.22 %.The Naive Bayes (NB) classifier achieved 67.41 %, while the Fuzzy NN classifier achieved 78.16 %.The Support Vector Machine (SVM) classifier achieved a result of 84.23 %, while the Decision Table (DT) classifier achieved a result of 84.89 %.The Random Tree (RT) classifier obtained a result of 87.3 %, while the Rough Set (RS) classifier obtained a result of 87.83 %.The multi-layer perceptron (MLP) classifier achieved 94.36 %, and the fuzzy unordered rule inductive algorithm (FURIA) achieved 95.07 %.Overall, the RF classifier was the most effective in accurately classifying and identifying obesity.

Performance evaluation
The main evaluation measures for classification problems include accuracy, precision, recognition, and the F1 score.Accuracy reflects the ratio of correctly classified instances to the total number of instances.Precision represents the proportion of correct positive predictions to all positive predictions.Recall, also referred to as sensitivity or "true-positive rate," indicates the ratio of correct positive predictions to the total number of correct positive instances.The F1 score, a measure of a classifier's balance between precision and recall, is calculated as the harmonic mean of precision and recall.
In addition to these metrics, ROC (Receiver Operating Characteristic) curves and AUC (Area under the Curve) are commonly used to evaluate the performance of binary classification models.ROC The curves illustrate the relationship between the rate of correct-positive predictions and the rate of false-positive predictions at different classification thresholds, while the AUC provides a comprehensive indicator of the classifier's performance by quantifying the area under the ROC curve.
The following table lists the criteria (equations) used in this study in order from Eqs. (1) to (9).For a detailed understanding of these formulae, please consult the relevant reference: =  *  −  * Several evaluation metrics derived from the confusion matrix are commonly used to evaluate the performance of classification models and facilitate comparisons between different models.A confusion matrix [71] or [72] is a tabular representation (see Table 3) that characterizes the performance of a classification algorithm.It is typically used in machine learning and statistics to evaluate the accuracy of a model in classifying a data set.
The confusion matrix is divided into four different categories: true-positive (TP), false-positive (FP), true-negative (TN), and false-negative (FN).True-positive (TP) refers to the number of correctly classified positive instances, while false-positive (FP) indicates the number of incorrectly classified positive instances.True-negative (TN) represents the number of negative instances that were correctly classified, and false-negative (FN) refers to the instances where negative classifications were inaccurately made.The passage above describes a study in which machine learning algorithms were used to classify features associated with obesity and evaluate their performance.Several algorithms were used in the study, including MLP, SVM, FuzzyNN, FURIA, RS, RT, RF, NB, LR, and DT, which are well established in the field of categorization and have a solid performance history.The models were subjected to ten-fold cross-validation, and their results were presented in tables and graphs.
The performance of the models was assessed in terms of accuracy, as shown in Table 4. Overall, the statement provides a comprehensive overview of the methodology and results of the study.
The above explanation provides a clear overview of how the confusion matrix is used to evaluate the performance of classification models and how it is used to calculate various performance measures.Table 5 shows that the results of the confusion matrix are given for all methods used, allowing a clear comparison of the performance of each method.Other metrics such as the kappa statistic, the mean absolute error, and the root mean square error are also important indicators for the analysis of a classification task and were used in this study to compare the performance of the machine learning algorithms.The results of these evaluations are shown in the following figures.Analyzing these graphs, we can see that the performance of each ML algorithm varies in terms of accuracy (KS, MAE, and RMSE).The highest accuracy was achieved by the Random Forest (RF) algorithm with 95.78 %.The lowest accuracy was achieved by the Naive Bayes (NB) algorithm with 67.41 %.The graphs also show the comparison of the algorithms in terms of KS, MAE, and RMSE.Overall, the results show that the RF algorithm performs best among the ten algorithms tested, while the NB algorithm performs worst.It is important to remember that this depends on the particular dataset and the problem being addressed.When choosing an appropriate ML algorithm for a particular task, other factors such as computational cost, interpretability, and scalability must also be considered.In this case, the RF algorithm might be a good choice for this particular classification problem due to its high accuracy, but further analysis and experimentation might be needed to confirm this.

Conclusions
The study proposed to use machine learning classification methods to estimate the prevalence of obesity in people from Mexico, Peru, and Colombia using accessible data on their eating habits and physical condition.The study highlights the importance of researching the extent of obesity, as it is associated with a wide range of diseases and affects people of all ages and genders.In the study, ten machine learning models -RF, LR, NB, FuzzyNN, SVM, DT, RT, RS, MLP, and FURIA -were used to build an intelligent model for detecting overweight or obese individuals, which can help professionals in the field in their decision-making.The results of the study show that RF achieves the highest accuracy of 95.78 % in performance measures.The study concludes that machine learning is an effective tool in medicine that can be used to make timely treatment decisions for people at risk of obesity.

Fig. 1 .
Fig. 1.Graphical distributions of attributes by obesity level

Fig. 3 .
Fig. 3. Comparison of the accuracy of ten classifiers

Table 4 .
Detailed accuracy by class Alg.TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area

Table 5 .
Confusion matrix for all models