## 3 Methodology
### Build Prediction Methods
#### 3.5.3. A Hybrid Intelligence of LSTM and the Genetic Algorithm (GA)  
Evolutionary algorithms (EA) are stochastic search and optimization methods that are based on genetic inheritance and ideas from Darwinian evolution. The paradigms of evolutionary computing are evolutionary programming, evolutionary strategies, and genetic algorithms. In this sense, genetic algorithms are optimization methods used to solve nonlinear, non-differentiable, discontinuous, or multimodal optimization problems. These algorithms are applied to solve optimization, classification, and regression problems [32]. Its operation generally consists of starting with an initial generation of candidate solutions, randomly generated or another method, which is tested with the objective function; then the following generations are produced, which evolve from the first generation through the typical genetic operators of selection, crossing, and mutation. Chromosomes, which represent a better solution to the objective problem, have a few more opportunities to \"reproduce\" and \"survive\" than those chromosomes that have poorer and \"weaker\" solutions. The \"goodness\" of a solution is usually defined with respect to the current population [33]. Evolutionary algorithms have been widely applied to neural networks, and various hybrid approaches have also been used for economic time series prediction. Genetic algorithms allow the learning algorithm to be improved by acting as a network training method, feature subset selection, and neural network topology optimization, as well as reducing the complexity of the feature space [34]. Figure 3 shows the hybrid GA-LSTM approach to find the time window size and the number of LSTM units for the prediction of the unemployment rate in Ecuador. Determining the time window and the number of LSTM units is quite important for the performance of the algorithm. If the window size is too small, the model will neglect important information, or if it is too large, the model will overfit the training data. Initially, the study consisted of designing the appropriate network parameters for the LSTM network. We use an LSTM network to solve the prediction problem using the feedforward architecture. This architecture consists of a sequential input layer, a Keras LSTM layer, and a dense output layer. GA investigates the optimal number of hidden neurons in the LSTM layer. In the GA-LSTM model, the hyperbolic tangent function is used as an activation function for the input nodes and the LSTM nodes, while the linear function is used as an activation function at the output node. The hyperbolic tangent function is a scaled sigmoid function and returns the input value in a range between \(-1\) and \(1\), and the linear activation function (identity) is directly proportional to the input, allowing the output to vary continuously and linearly. The activation function of the output node is designated as a linear function because our goal is the prediction of next month's unemployment rate, which can be formulated as a regression problem. The initial network weights are set as random values, and the network weight is adjusted using the \"Adam\" stochastic optimization method; this optimization algorithm was developed by [PERSON] and [PERSON]. Among its characteristics, it stands out that it is simple to implement, it is computationally efficient, it has few memory requirements, it is suitable for problemsthat are large in terms of data and/or parameters, and it is appropriate for non-stationary objectives, among others [35]. We then employ the GA heuristic search method to investigate the optimal size of the time windows and the architectural factors of the LSTM network. Various time window sizes and different numbers of units are applied in the LSTM layer to evaluate the fitness of GA. Populations are composed of possible solutions and are initialized with random values before genetic operators start exploring the search space.