## 3 Background  
### ML Models  
In this study, four different models were employed to predict the diagnosis and severity of pediatric appendicitis: LR, RF, XGBoost, and MLP. Each model was selected for its capacity to handle classification tasks and its potential to enhance diagnostic accuracy in a clinical setting. LR is a well-established statistical model used for binary classification. It predicts the probability that an observation belongs to one of two classes by applying the logistic function. The model is mathematically represented as:  
\[P(Y=1|X)=\frac{1}{1+e^{-(\beta_{0}+\beta_{1}X_{1}+\cdots+\beta_{n}X_{n})}}\]  
where \(P(Y=1|X)\) denotes the probability of the outcome being 1 given the predictors \(X\), and the \(\beta\) coefficients are estimated from the data. The simplicity and interpretability of LR make it a powerful tool in clinical applications, where understanding the influence of each predictor is important. However, one key limitation of LR is that it assumes a linear relationship between the predictors and the log-odds of the outcome, which may not hold in more complex datasets. A DT is a non-parametric model that uses a tree-like structure to make decisions based on the input features. The tree recursively splits the data at each node based on a feature that maximizes the purity of the resulting subgroups, using metrics such as Gini impurity or entropy. For example, the Gini impurity is calculated as:  
\[G=1-\sum_{i=1}^{C}p_{i}^{2}\]  
where \(p_{i}\) represents the proportion of class \(i\) in a given node. DTs are easy to interpret, as the model's structure provides a clear path from features to the predicted outcome. Their strength lies in their simplicity and ability to capture non-linear relationships. However, DTs are prone to overfitting, especially when the tree grows deep, capturing noise in the training data. RF is an ensemble learning technique that builds upon the DT model by constructing multiple trees, each trained on a random subset of the data and features. The final prediction is made by aggregating the predictions from all trees, typically using a majority vote for classification tasks. The mathematical framework behind RF is based on the principle of bagging, which reduces variance by averaging multiple weak learners. The model's ability to handle high-dimensional datasets and its robustness to overfitting make it particularly useful for complex problems. However, RF models can be computationally expensive, and their interpretability decreases as the number of trees increases, compared with a single DT. XGBoost, or eXtreme Gradient Boosting, is another ensemble method that improves upon traditional boosting techniques by training sequential DTs to correct the errors of previous trees. The objective function that XGBoost optimizes includes a regularization term to control the complexity of the model, minimizing overfitting. Mathematically, the objective function is:  
\[L(\theta)=\sum_{i=1}^{n}l(y_{i},\hat{y}_{i})+\sum_{k=1}^{K}\Omega(f_{k})\]  
where \(l(y_{i},\hat{y}_{i})\) represents the loss function (e.g., log loss for classification), and \(\Omega(f_{k})\) is the regularization term. XGBoost is known for its high performance, particularly in structured datasets, due to its optimization of both speed and accuracy. Its main drawback lies in the complexity of tuning its hyperparameters, such as the learning rate, maximum tree depth, and the number of boosting rounds. A MLP is a type of feedforward neural network used for classification tasks. A MLP consists of an input layer, one or more hidden layers, and an output layer, where each neuron in one layer is connected to neurons in the next layer. Each neuron's output is computed as a weighted sum of its inputs passed through an activation function, such as the logistic sigmoid function:  
\[\hat{y}=\sigma(WX+b),\quad\sigma(x)=\frac{1}{1+e^{-x}}\]  
where \(W\) represents the weights, \(X\) represents the input, and \(b\) is the bias term.