# Comparative Analysis of Machine Learning Methods for Predicting Energy Recovery from Waste
## 2 Materials and Methods
### Neural Network  
Neural networks are a core class within machine learning, widely applied to both classification and regression tasks. The structure of ANN is complex, containing layers that start with inputs and progressing through hidden layers with interconnected neurons. These neurons process inputs using weights and biases, employing activation functions to enable non-linearity, crucial for capturing complex patterns within data [35].  
In a neural network, each neuron within a particular layer calculates an input summation. This is mathematically expressed by combining each input multiplied by its corresponding weight, adding a bias specific to that neuron [36; 37]. The formula for this summation for any neuron is indexed as \(j\) in a given layer \(l\) as (4):  
\[z_{j}^{(l)}=\sum_{i}w_{ij}^{(l)}x_{i}+b_{j}^{(l)} \tag{4}\]  
where \(z_{j}^{(l)}\) is the aggregated input to neuron \(j\) in layer \(l\), \(w_{ij}^{(l)}\) represents the weight from neuron \(i\) in the previous layer to neuron \(j\) in the current layer, \(x_{i}\) is the input from neuron \(i\) or the input feature if \(l\) is the input layer, and \(b_{j}^{(l)}\) is the bias term for neuron \(j\) in layer \(l\).  
Activation functions enable neurons in a neural network to capture and represent complex data patterns by introducing non-linear dynamics into the system. When anactivation function f is applied to the aggregated sum \(z_{j}^{(l)}\) for neuron j in layer l, the resulting output \(a_{j}^{(l)}\) is given by (5):  
\[a_{j}^{(l)}=f\Big{(}z_{j}^{(l)}\Big{)} \tag{5}\]  
This transformation is pivotal for the ability of the network to perform tasks beyond linear separation, which is essential for tackling intricate problems in machine learning.  
Neural networks are renowned for their proficient handling of intricate and non-linear data patterns, which is vital for numerous complex tasks such as visual and auditory recognition, as well as predictive analysis. They adapt through a method of iterative optimization, where connection weights are tuned in response to discrepancies between actual and estimated outputs, with the goal of reducing error within the training dataset. This flexibility and profound learning capacity are pivotal for the progression of machine learning and artificial intelligence.  
A neural network with a single hidden layer was constructed, varying the neurons from 2 to 20. The selection of this particular neuron count was the result of an iterative testing process. Various neuron configurations were evaluated to pinpoint the most effective number that strikes an optimal balance between the complexity of the model and its predictive performance. It evaluated three learning algorithms: Levenberg-Marquardt (L-M), Bayesian Regularization (BR), and Scaled Conjugate Gradient (SCG), chosen for their effectiveness. The L-M algorithm, though swift, is memory-intensive. Training ceases when validation errors stop decreasing, signaling overfitting. BR, albeit slower, tends to generalize better, particularly for complex datasets, halting training as it adjusts for overfitting. SCG, a more memory-efficient method, also stops when validation error reduction stalls. The dataset consisted of 225 observations. The dataset split was comprised of 75% for training, with the remaining 30% equally divided between validation and testing.