A Systematic Assessment of Genetic Algorithm GA in Optimizing Machine Learning Model A Case Study From Building Science
A Systematic Assessment of Genetic Algorithm GA in Optimizing Machine Learning Model A Case Study From Building Science
Abstract - Machine learning (ML) algorithms are such as first-order optimizers (Batch gradient
techniques that allow computers to learn from the data descent, AdaMax, AdaDelta, among others), second-order
without being explicitly programmed. ML techniques consist optimizers (quasi-Newton’s method, conjugate gradient
of hyperparameters that typically influence prediction descent, among others), swarm intelligence optimizers
accuracy, hence requiring tuning. In this study, we (swarm optimizers, grey wolf optimizers, among others).
systematically evaluate the performance of the genetic
algorithm (GA) technique in tuning ML hyperparameters
Other methods such as greedy search, heuristic algorithms,
compared to three other common tuning techniques i.e. grid reinforcement learning, and evolutionary algorithms are
search (GS), random search (RS), and bayesian optimization also being applied [6]. As mentioned, GS or sometimes
(BO). While previous studies explored the potential of referred to as exhaustive search has been used in ML
metaheuristics techniques such as GA in tuning ML models, hyperparameter optimization since the 1990s [4]. It is
a systematic comparison with other commonly mentioned simply selecting and testing all possible combinations from
techniques is currently lacking. Results indicate that GA the defined range of hyperparameters, hence a brute force
slightly outperformed other methods in terms of optimality technique. GS has been applied in several ML
due to its ability to pick any continuous value within the hyperparameter tuning studies such as [3], [2]. Although
range. However, apart from GS which took the longest, it was
observed that GA is quite a time inefficient compared to RS
GS can guarantee optimality within the defined range of
and BO which were able to find a solution close to the GA values (defined grid), it can also be observed that this
within a shorter time (GA – 149 minutes, RS – 88 minutes, BO technique is not time efficient. For example, 6
– 105 minutes, GS – 756 minutes). hyperparameters with 10 values will require 106 iterations
which are computationally expensive and time-costly [7],
Keywords – Genetic algorithm, Hyperparameter, [8].
Machine learning,
Due to GS time limitations, another technique known as a
I. INTRODUCTION random search (RS) is introduced. RS selects and tests
random combinations from a set of possible combinations
A. Background until a certain stopping criterion is met [4]. The stopping
criteria include reaching a threshold prediction accuracy
Generally, machine learning (ML) models can be regarded and reaching a maximum number of iterations i.e. number
as optimization problems as it is looking for the best fit of of randomly tested combinations, among others. Although
independent variables to the target variable, some such in some problems, RS can perform as well as a GS [9], it is
examples are mentioned in [1]. However, a more common not always the case. This typically results in a trade-off
application of optimization techniques in machine learning between the two techniques. Unlike GS and RS, another
is in tuning the ML model hyperparameters. Machine technique known as Bayesian optimization (BO) is a
learning model performance is typically influenced by model-based technique that approximates the true
some of the parameters known as hyperparameters. For objective function using a surrogate model such as the
example, any tree-based model such as random forest (RF), Gaussian process. Rather than exploring randomly in the
gradient boosting (GB), and extreme gradient boosting search space, this technique has a mechanism to explore the
(XGB) are influenced by hyperparameters such as the search space areas that will improve the results [10]. Just
number of trees generated, maximum size of the tree, like RS, BO is also controlled by the number of iterations,
contribution of each tree in the overall model, among which reflects the number of hyperparameter combinations
others. [2]. Likewise, artificial neural network (ANN) tested. Additionally, metaheuristic techniques such as
models are influenced by the number of hidden layers. genetic algorithm (GA) is another optimization technique
Hence, finding the best combination of hyperparameters is that is widely applied in tuning ML models such as deep
quite crucial in providing a better predictive performance learning, tree-based models, artificial neural networks
of models. Several optimization techniques are used in (ANN), Support Vector Machine (SVM), Naïve Bayes, K-
tuning machine learning (ML) hyperparameters. nearest neighbors (KNN), polynomial, and logistic
Traditional methods such as grid search (GS) and random regression [11], [12], [13], [14], [15], [16]. Conceptually,
search (RS) are widely used [2], [3], [4]. Additionally, GA starts with the initial population and keeps on selecting
other techniques are also being applied, for example, [5]
mentions techniques that are tested in tuning deep learning
0384
Authorized licensed use limited to: Arizona State University. Downloaded on April 09,2025 at 03:23:06 UTC from IEEE Xplore. Restrictions apply.
Proceedings of The 2022 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM)
0385
Authorized licensed use limited to: Arizona State University. Downloaded on April 09,2025 at 03:23:06 UTC from IEEE Xplore. Restrictions apply.
Proceedings of The 2022 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM)
0386
Authorized licensed use limited to: Arizona State University. Downloaded on April 09,2025 at 03:23:06 UTC from IEEE Xplore. Restrictions apply.
Proceedings of The 2022 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM)
B. ML hyperparameter tuning
TABLE IV
GA PARAMETERS COMBINATIONS (* refers to
optimal set)
SET NO. POP. SIZE CP MP GEN.
1 25 0.1 0.01 50
2 25 0.1 0.5 50
3 25 0.1 0.9 50
4 25 0.5 0.01 50
5 25 0.5 0.5 50
6 25 0.5 0.9 50
7 25 0.9 0.01 50
8 25 0.9 0.5 50 Fig. 3. RS results compared to GS
9 25 0.9 0.9 50
10 50 0.1 0.01 50 For the RS, several iterations were evaluated i.e. 50, 100,
11 50 0.1 0.5 50
12 50 0.1 0.9 50 200, 500, and 1000 iterations. A significant observation
13 50 0.5 0.01 50 from Fig. 3, shows that none of the RS results were able to
14* 50 0.5 0.5 50 be better than the GS result. As it is obvious that the
15 50 0.5 0.9 50 optimal MSE obtained from RS can only be as good as GS
16 50 0.9 0.01 50
17 50 0.9 0.5 50 but never better. This is because RS is picking a set of
18 50 0.9 0.9 50 parameters randomly from the grid instead of iterating
through all of them as in GS, so there is a chance that the
The list of parameters and their respective ranges are listed randomly picked combination to be the optimal one within
in Table. III. With 50 generations in each set of parameters, the specified range. It was also observed that, with a higher
a total of 18 combinations or sets of combinations were number of iterations, even better optimal MSE was
tested. The optimal parameters are then fixed when tuning obtained. However, this may not always be the case due to
the ML hyperparameters. All tested combinations (set of the randomness within the RS.
parameters) are listed in Table. IV. From Fig. 2, it can be
noted that set 14 obtained minimum MSE (0.11417), hence
the optimal set of parameters. The results highlight the
necessity of tuning GA parameters as clearly observed
different values of parameters yielded different MSE
values. Some sets obtained MSE values close to the
optimal value, for example, set 3, 12, and 16 while other
sets obtained higher MSEs such as sets 1, 8, and 13.
0387
Authorized licensed use limited to: Arizona State University. Downloaded on April 09,2025 at 03:23:06 UTC from IEEE Xplore. Restrictions apply.
Proceedings of The 2022 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM)
0388
Authorized licensed use limited to: Arizona State University. Downloaded on April 09,2025 at 03:23:06 UTC from IEEE Xplore. Restrictions apply.
Proceedings of The 2022 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM)
0389
Authorized licensed use limited to: Arizona State University. Downloaded on April 09,2025 at 03:23:06 UTC from IEEE Xplore. Restrictions apply.