Full text
MMAA Mestrado em Métodos Analíticos Avançados Master Program in Advanced Analytics NOVA Information Management School Instituto Superior de Estatística e Gestão da Informação Universidade Nova de Lisboa A STUDY OF GEOMETRIC SEMANTIC GENETIC PROGRAMMING WITH LINEAR SCALING Berfin Sakallioglu Dissertation presented as partial requirement for obtaining the Master’s degree in Data Science and Advanced Analytics, with a specialization in Data Science
NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade NOVA de Lisboa A STUDY OF GEOMETRIC SEMANTIC GENETIC PROGRAMMING WITH LINEAR SCALING by Berfin Sakallioglu Dissertation presented as partial requirement for obtaining the Master’s degree in Data Science and Advanced Analytics, with a specialization in Data Science Adviser: Prof. Dr. Leonardo Vanneschi February, 2023 Advisor:
A Study of Geometric Semantic Genetic Programming with Linear Scaling Copyright ©Berfin Sakallioglu, NOVA Information Management School, NOVA University Lisbon. The NOVA Information Management School and the NOVA University Lisbon have the right, perpetual and without geographical boundaries, to file and publish this dissertation through printed copies reproduced on paper or on digital form, or by any other means known or that may be invented, and to disseminate through scientific repositories and admit its copying and distribution for non-commercial, educational or research purposes, as long as credit is given to the author and editor. This document was created with the (pdf/Xe/Lua)L A T EX processor and the NOVAthesis template (v6.10.12) [1].
To Ankara.
Acknowledgements I would like to express my deepest gratitude to my esteemed professor, Leonardo Vanneschi, for his exceptional mentorship and constructive feedback throughout my academic journey. His remarkable intellect and dedication to the pursuit of knowledge have been a source of inspiration. I am deeply indebted to him for his patience, understanding, and kindness. His unwavering support and trust have given me strength to overcome challanges. My heartfelt appreciation goes to every person in my beautiful big family with special thanks to my mom, dad and wonderful brother, Utku. Thank you for giving me life, your unconditional love, support, and your existence. I am lucky to have all of you. And all the amazing people in my life, my friends, my people in Ankara, I am glad that I grew up with all of you. You have all played a significant role in shaping me. And to Lisbon, and the people who embraced and loved me in this city. Thank you for being a family to me in a place so far away from my home. To all these people and everyone who directly or indirectly helped me with my thesis period, I am deeply greatful, this would have been impossible without you. And finally, the cumulative knowledge of humanity, thank you. Despite everything, ending up on this planet has been great! vii
Contents List of Figures xvii List of Tables xix 1 Introduction 1 2 Theoretical Background 3 2.1 Machine Learning .............................. 3 2.1.1 Data ................................. 4 2.1.2 Learning ............................... 4 2.2 Optimization ................................. 6 2.2.1 Fitness Landscapes ......................... 7 2.3 BioInspired and Evolutionary Algorithms ................ 7 2.3.1 Genetic Programming ....................... 8 2.3.2 Geometric Semantic Genetic Programming ........... 12 2.3.3 GSGP Implementation ....................... 16 2.4 Linear Scaling ................................ 17 3 Literature Review 19 3.1 Semantics in GP ............................... 19 3.2 LS in GP ................................... 21 4 Methodology 23 4.1 General Organization of the GSGP-LS Library ............. 23 4.2 GSGP ..................................... 24 4.3 Population .................................. 25 4.3.1 Initialization ............................. 25 4.3.2 Offspring Creation ......................... 26 4.3.3 Scoring a Population ........................ 27 4.4 Individual .................................. 29 xv
4.4.1 Reconstruction ........................... 29 4.5 Node ..................................... 29 5 Experimental Study 31 5.1 Experimental Setup ............................. 31 5.1.1 Parameter Settings ......................... 31 5.1.2 Case Studies ............................. 33 5.2 Experimental Results ............................ 44 5.2.1 Regression Experiments ...................... 44 5.2.2 Synthetic Dataset Experiments .................. 50 5.2.3 Classification Experiments .................... 53 5.3 Discussion on Results ............................ 57 6 Conclusions and Future Work 61 Bibliography 63 xvi
List of Figures 2.1 Confusion MatrixandErrorMeasures forClassification (Reprintedfrom [22]) 6 2.2 Briefly, optimization methods and the position of EAs in this context. . . 8 2.3 A graphic depiction of the iterative work-flow of an evolutionary algorithm, including GP, that is driven by the concepts of Darwin’s Theory of Evolution.(Reprinted from [34]) ........................... 9 2.4 Abstractsyntax tree representation in GP ofthe function 𝑓(𝑥1, 𝑥2, 𝑥3)=𝑥1−𝑥2+𝑥3∗𝑥1 . (Inspired from [38]) ............................... 10 2.5 Grow Algorithm (Taken from [40]) ...................... 11 2.6 Relationship between genotypic and semantic space. The semantic space is depicted in 2D in the figure, which corresponds to the unrealistic case in which only two training instances exist. (Reprinted from [40]) ...... 13 2.7 A graphical representation of the effect of geometric crossover, in the simple bidimensional case. (Reprinted from [26]) .................. 14 2.8 A graphical representation ofthe effectofgeometricmutation (box mutation), in the simple bi-dimensional case. (Reprinted from [26]) .......... 14 2.9 Tree representation of the GSC formula. (Inspired from [34]) ....... 15 2.10 Tree representation of the GSM formula. (Inspired from [34]) ....... 15 2.11 Illustration of the example described above. (a) The initial population 𝑃 ; (b) The random trees used by crossover; (c) The representation in memory of the new population 𝑃′. (Reprinted from [45]) ................ 16 5.1 Histogram of the target columns. ....................... 36 5.2 Histogram of the target columns. ....................... 38 5.3 Histogram of the target columns. ....................... 40 5.4 Results of the experimental comparison between GSGP and GSGP-LS with Boston, Concrete and Parkinson datasets. .................. 46 5.5 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test data for Boston, Concrete and Parkinson datasets. . . . 46 5.6 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on training data for Boston, Concrete and Parkinson datasets. . 47 xvii
5.7 Results of the experimental comparison between GSGP and GSGP-LS with Istanbul, Bioavailability, LD50 datasets. ................... 47 5.8 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test data for Istanbul, Bioavailability, LD50 datasets. . . . . 48 5.9 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on training data for Istanbul, Bioavailability, LD50 datasets. . . 48 5.10 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test data for PPB, Docking and Fludarabine datasets. . . . . 48 5.11 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on training data for PPB, Docking and Fludarabine datasets. . 49 5.12 Results of the experimental comparison between GSGP and GSGP-LS with PPB, Docking, Fludarabine datasets. ..................... 49 5.13 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test data for problem_4, problem_5 and problem_6 datasets. 50 5.14 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on training data forproblem_4, problem_5 andproblem_6 datasets. 51 5.15 Results of the experimental comparison between GSGP and GSGP-LS with problem_4, problem_5 and problem_6 datasets. .............. 51 5.16 Results of the experimental comparison between GSGP and GSGP-LS with problem_7, problem_8 and problem_9 datasets. .............. 52 5.17 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test data for problem_7, problem_8 and problem_9 datasets. 52 5.18 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on training data forproblem_7, problem_8 andproblem_9 datasets. 53 5.19 Confusion Matrices of the best individuals of Banknote Authentication . 54 5.20 Confusion Matrices of the best individuals of Spotify Funk Songs . . . . 55 5.21 Confusion Matrices of the best individuals of Breast Cancer Wisconsin . 55 5.22 Results of the experimental comparison between GSGP and GSGP-LS with Banknote, Spotify and Wisconsin datasets. .................. 56 5.23 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test data for Banknote, Spotify and Wisconsin datasets. . . . 56 5.24 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on training data for Banknote, Spotify and Wisconsin datasets. 57 5.25 Results of the experimental comparison between GSGP and GSGP-LS with problem_4 with the alternative function set. ................. 58 5.26 Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test and training data for problem_4 with the alternative function set. ...................................... 58 xviii
List of Tables 4.1 GSGP Entities .................................. 24 4.2 GSGP Parameter Definitions ......................... 24 5.1 Parameter settings. ............................... 32 5.2 Number of instances and attributes of regression datasets. ........ 33 5.3 Attributes of Boston Housing. ......................... 35 5.4 Attributes of Concrete Compressive Strength. ................ 35 5.5 Attributes of UPDRS. .............................. 37 5.6 Attributes of Istanbul Stock Exchange. .................... 38 5.7 Synthetic dataset settings. ........................... 41 5.8 Classification Datasets. ............................. 41 5.9 Attributes of Banknote Authentication. .................... 42 5.10 Features of Spotify Funk Songs ........................ 43 5.11 Median Classification Report of Banknote .................. 54 5.12 Median Classification Report of Spotify Funk Songs ............ 54 5.13 Median Classification Report of Breast Cancer Wisconsin ......... 55 xix
1 Introduction Genetic Programming (GP) is a general-purpose method to automatically breed computer programs to solve a task [2]. In the last decade, the use of GP [2] to tackle symbolic regression problems has gained popularity, possibly because of some qualities of GP, such as its ability to deal with problems where little or no information is known about the data, its ability to evolve models that do not have a previously fixed mathematical shape, and to perform automatic feature selection while learning the model [3–5]. GP is traditionally employed to tackle symbolic regression problems using well-known loss measures, such as the root mean square error (RMSE), to quantify the fitness of the evolving solutions. Even though this approach is still very popular, it has a drawback: some solutions may receive a bad fitness value, promising though they might be. It is the case, for instance, of solutions that have a similar shape to the one of the target function, but with different slope and/or location in the Cartesian space. Linear scaling (LS) was thus introduced by Keijzer [6] to tackle this issue and improve the performance of GP on symbolic regression. LS modifies the fitness function rescaling each individual by using their slope and intercept, two constants that can be easily calculated with a cost that is linear in the size of the training set. In this way, the burden of searching for these two constants is removed from the evolution, leaving GP with the only task of searching for functions whose shape is most similar to that of the target function. Since its introduction, the benefit of LS was demonstrated on many theoretical benchmark functions [6] and real-life applications [7–10]. These studies indicate that LS does not only improve standard GP on training data, but can also bestow on GP a better generalization ability, often outperforming standard GP also on unseen data. However, Costelloe and Ryan [11] pointed out that LS may not always improve GP’s generalization ability. Ten years after the introduction of LS, Moraglio et al. [12] introduced Geometric Semantic GP (GSGP), a different variant of GP. GSGP uses specific genetic operators, called Geometric Semantic Operators (GSOs), instead of the traditional crossover and mutation of GP. Although acting directly on the syntax of the GP individuals, GSOs have an indirect known effect on their semantics, and have the important property of 1
CHAPTER 1. INTRODUCTION inducing a unimodal error surface for any supervised learning problem [12]. Several results were presented revealing the ability of GSGP to effectively fit training data [12, 13]. At the same time, GSGP was also shown to limit overfitting, often outperforming standard GP on unseen data for several real-life symbolic regression problems [14]. Given that LS works by redefining the fitness and GSGP works by redefining the genetic operators, which are in general two independent parts of the GP algorithm, it is natural to imagine a system that joins these two methods, possibly capturing the advantages of both GSGP and LS. Following this idea, in 2015 Vanneschi et al. [15] combined GSGP and LS, achieving outstanding results on a challenging application based on AIS (Automatic Identification System) for the prediction of the positions of vessels at sea. The success of that system in that particular application domain, together with the previous achievements of GSGP and LS used in isolation, may induce researchers to think that the integration of GSGP and LS is always beneficial. However, Costelloe’s and Ryan’s [11] observations made on standard GP sound like an important warning and call for a methodological study aimed at investigating the pros and cons of integrating GSGP and LS. This dissertation presents a GSGP algorithm and an investigation of a system that employs GSOs to explore the search space, guided by the LS fitness function, in a manner similar to that of the approach proposed in [15]. The proposed system is referred to as GSGP-LS. Furthermore, this work employs the GSGP and LS methods to address classification problems where no prior utilization has been implemented. The document is structured as follows. Chapter 2, Theoretical Background, provides the reader with sufficient knowledge to comprehend the presented work, including a general understanding of Machine Learning (ML), optimization, bioinspired and Evolutionary Algorithms (EAs), as well as LS. Chapter 3, Literature Review, briefly reviews previous works relevant to this study, including both semantics in GP and LS in GP. Chapter 4, Methodology, presents a detailed description of the GSGP-LS algorithm developed for this work. A discussion of the software implementing GSGP-LS has been organized and developed. In Chapter 5, the experimental setup is described, starting with the parameter settings, followed by presentation of the case studies, the obtained experimental results and a discussion of the results. Finally, Chapter 6concludes the work with an overview containing the results of the work, limitations, and ideas for future research. 2
2.3. BIOINSPIRED AND EVOLUTIONARY ALGORITHMS to evolve in order to find the most successful among them to solve a problem at hand. With sexual recombination (crossover) of the parental computer programs, GP generates a new population of offspring [2]. Because parental programs are chosen in proportion to their fitness measures, the Darwinian principle of survival of the fittest is applied. The goal of using natural selection and genetic operators to create a computer program that solves or approximates a given problem is, in fact, the definition of optimization. The concepts identifying natural selection are reproduction,ability of adaptation to the environment,hereditariness,variation and competition. These are duplicated to an extent in the algorithm [26]. Over many generations, GP algorithms may exhibit increasing average fitness and effectively adapt to environmental changes [2]. Figure 2.3: A graphic depiction of the iterative work-flow of an evolutionary algorithm, including GP, that is driven by the concepts of Darwin’s Theory of Evolution.(Reprinted from [34]) At this point it is important to state that GP originated from Genetic Algorithms (GA) introduced by Holland in 1975 [35] and Goldberg in 1989 [36]. Just like GP, GAs are algorithms based on the mechanisms of natural selection and genetics. GAs are used to perform optimization by mimicking the biological systems’ robustness, efficiency and flexibility [36]. Despite the fact that the evolutionary process is very similar to that of GPs, there is a critical difference between GAs and GPs, which is representation. Individuals in GAs are not computer programs, but rather fixed-length character strings that correspond to chromosomes in nature [36]. This representation, when used with GPs, limits the internal states of the system due to its fixed-length and cannot keep up with dynamically varying programs [2]. 9
CHAPTER 2. THEORETICAL BACKGROUND 2.3.1.1 Representation of the GP Individuals Abstract syntax tree representation is widely used with GP where a tree represents a computer program, a function that solves the given problem. The tree is constructed using nodes. The node values can be either functions or terminals. The terminals are specified as a constant value from a predefined set [37]. Node values are selected from two sets: Function Set ( 𝐹 ) and Terminal Set ( 𝑇 ). The types of functions may vary, but for the purposes of this thesis, examples of binary operations such as addition, subtraction, multiplication, and division would suffice, as would examples of unary operations such as 𝑠𝑖𝑛 , 𝑐𝑜𝑠 , and 𝑙𝑜𝑔 . Because it corresponds to the structure of the tree, the representation is considered the genotype of an individual. The fitness of individuals is referred to as the phenotype of an individual. Having a tree-based representation may appear as having an infinite search space but the trees are limited by restricting their depth. In contrast to the fixed-length representation of GAs, tree representation of GP allows trees to grow. This may increase the generalization and solution capacity of GP compared to GAs. Figure 2.4: Abstract syntax tree representation in GP of the function 𝑓(𝑥1, 𝑥2, 𝑥3)=𝑥1−𝑥2+𝑥3∗𝑥1. (Inspired from [38]) 2.3.1.2 Initialization Initialization is the process of creating the trees of the first population. This is the first step for GP as it is for any evolutionary algorithm. The mechanisms of natural selection depend heavily on diversity. In GP, this refers to the variation in the genotype (representation) or phenotype (fitness) of the individuals within a population. Genetic search will often be more robust if the population is made up of a wider variety of individuals since it will encourage the exploratory stage of the search [39]. At this work, three major initialization methods is implemented. Grow: The grow algorithm begins by creating the root of the tree. A random symbol from the Function Set ( 𝐹 ) is chosen with uniform probability, and the operand 10
2.3. BIOINSPIRED AND EVOLUTIONARY ALGORITHMS is chosen from the combination set of 𝐹 and Terminal Set ( 𝑇 ). If the node value is a terminal, the node is a leaf, indicating that the branch stopped growing. This process is repeated until either the maximum depth is reached or all of the nodes at depth 𝑑 have terminal values [40]. A pseudocode for the algorithm is below. Figure 2.5: Grow Algorithm (Taken from [40]) Full: Full initialization begins in the same way that grow does. It chooses a random symbol from 𝐹 to become the root of the tree. However, nodes from depth 2to 𝑑− 1 are only chosen using the function set 𝐹 , and nodes at the maximum depth are chosen from the terminal set 𝑇 . Thus, full differentiates from grow only in the line marked with ◦. It never selects a terminal at that stage, only a function [40]. The difference between these methods is that trees created with full initialization have all oftheir branches the same length, whereas trees created with grow initialization have branches with irregular shapes. Ramped Half-and-Half: The most common and traditional method, and the one used in this work, is the Ramped Half-And-Half (RHH) method defined by Koza [2]. It makes use of the full algorithm together with the grow algorithm. This method is advantageous because it allows trees with a wide range of sizes and shapes to be generated. When used independently, full initialization and grow initialization produce less diverse populations since the generated trees may be too similar to one another. RHH is used to increase the initial diversity of the population diversity. The RHH method generates two groups of trees with depths ranging from 2to 𝑑 . As it stated in its name, 50% of the trees are generated by full and 50% is generated by grow. 2.3.1.3 Fitness Evaluation The success of individuals is measured by calculating their fitness. During the evolutionary process, individuals with better fitness are more likely to be able to pass on their genes to the future generations following the Darwinian principle [31]. This phenomenon is ensured by the selection process. 11
CHAPTER 2. THEORETICAL BACKGROUND 2.3.1.4 Selection Selection defines the procedure to select parents from an existing population to produce offspring that will form the new generations of evolution process. Even though different selection methods such as fitness proportionate selection (roulette wheel) [35], ranking selection [41] and tournament selection [42] can be used for the implementation of GP, tournament selection is opted for this work. This choice is motivated in Chapter 5. Tournament selection is a selection algorithm with two fragments, the first of which is random and the second of which is deterministic. With a pre-defined tournament size 𝑘 , to select one of the parents from a population, a subset of the population with size 𝑘 is created randomly [43]. Out of this smaller set, the fitness of every individual is compared and the best one is chosen to become a parent. This step is entirely deterministic. The tournament size establishes a variable called selection pressure. Lower tournament sizes indicate a low selection pressure, while higher values indicate a high selection pressure, which corresponds to how likely the best individuals are to survive [26]. Always selecting the best individual of the whole population might sound like a good idea at first but maintaining diversity is crucial. By keeping the tournament size small, the selection pressure is reduced, and it is ensured that individuals with lower fitness are occasionally chosen to maintain diversity. 2.3.1.5 Genetic Operators There are mainly two types of genetic operators. Operators used in GP will be presented without details since it differs from GSGP. But it is essential to comprehend the purpose of these operators which are in fact analogous their biological definitions. They introduce variation into the evolutionary process of the individual. Crossover: This sexual recombination operation is carried out between two parents to produce two offspring. Each offspring inherits a portion of the representation of one parent and a portion of the representation of the other parent, just as the chromosomes of living beings [2]. Mutation: Unlike crossover, to perform this operation, only one individual is required. Mutation can occur by altering a part of a tree representation. This operation also introduces diversity and has the potential to produce beneficial results [2]. 2.3.2 Geometric Semantic Genetic Programming The point of focus of this thesis is GSGP, a GP modification. It is distinct from the GP due to its novel genetic operators. Traditional crossover and mutation algorithms are replaced with special operators, which distinguishes this method from GP. In GSGP, semantics is exploited by the genetic operators. Semantics is defined as the vector of the output values of an individual on the input data [26]. Traditional GP, according to Moraglio, ignores the "meaning" of the problems during the search process [12]. For 12
2.3. BIOINSPIRED AND EVOLUTIONARY ALGORITHMS example, in GP, the crossover is performed by swapping a subtree of parents without taking into account the effect on semantics, making this procedure blind. Since the success of the individuals is measured by fitness, it is coherent to consider the meaning, the semantics of the individuals during evolutionary process. Geometric operators which are used in GSGP are focalize on this meaning. 2.3.2.1 Semantics and Fitness Landscape For a better understanding of GSGP, it is important to return to the context of optimization problems. A population of the tree-based representations of individuals can be defined as a genotypic space or syntactic space since this space contains the structures [26]. Since every individual has a semantic, it is also possible to define a space with semantics. Individuals in semantic space are represented by their semantics rather than tree structures. Due to the fact of semantics being a vector, this makes it possible for the individuals to be represented by a point in this semantic space [12]. In supervised learning, it is also possible to indicate the target, the global optimum in this space. Since the objective of optimization is to find an individual with best fitness or at least to have an approximated solution, fitness can be calculated as, using any metric, distance (e.g. Euclidean distance) between semantics and the target. Figure 2.6: Relationship between genotypic and semantic space. The semantic space is depicted in 2D in the figure, which corresponds to the unrealistic case in which only two training instances exist. (Reprinted from [40]) 2.3.2.2 Operators in Semantic Space It was suggested in the literature in 1950 that when using evolution, it is important to find a method to prevent completely random mutations and to perform this operation in a way that has the potential to improve the success of an individual [16]. Two operators, geometric crossover and geometric mutation were introduced by Moraglio and Poli in 2004 [44]. As previously stated, the traditional crossover and mutation operators function on the genotypic (syntactic) representations of individuals. They proposed 13
CHAPTER 2. THEORETICAL BACKGROUND a framework for crossover and mutation operators based on landscape topology and geometry, which is associated with semantic space. This framework ensured an automatic method of deriving mutation and crossover from the neighborhood structure of a landscape. This clarified the connection between representation, genetic operators, neighborhood structure and distance in the landscape [44]. Geometric crossover is performed with two parents to obtain a single offspring located between its parents in space. It should be noted that this operation only creates one offspring. Figure 2.7: A graphical representation of the effect of geometric crossover, in the simple bidimensional case. (Reprinted from [26]) Geometric mutation, also known as box mutation, mutates an individual by randomly perturbing its coordinates within a certain range (box). Figure 2.8: A graphicalrepresentation ofthe effectofgeometric mutation (box mutation), in the simple bi-dimensional case. (Reprinted from [26]) 2.3.2.3 Geometric Semantic Crossover (GSC) When an offspring is created with geometric crossover in semantic space, where fitness is calculated as the distance of an individual to the global optimum, it will be located on a linear line between the parents. The betweenness property of geometric crossover ensures that offspring do not deviate further from the global optimum than the worst parent already is. This ensures that the fitness of the offspring is never worse than the fitness of the worst parent. Moraglio defined the GSC operator, which corresponds to geometric crossover on the semantic space [12,26]. 14
2.3. BIOINSPIRED AND EVOLUTIONARY ALGORITHMS Geometric Semantic Crossover. Given two parent functions 𝑇1, 𝑇2:R𝑛→R , GSC returns the real function 𝑇𝑋𝑂 =(𝑇1·𝑇𝑅)+((1−𝑇𝑅)·𝑇2) , where 𝑇𝑅 is a random real function whose output values range in the interval [0,1]. Figure 2.9: Tree representation of the GSC formula. (Inspired from [34]) 2.3.2.4 Geometric Semantic Mutation (GSM). Similarly, in semantic space, when an individual is mutated with geometric mutation, mutation can always improve fitness by allowing the point to move closer to the global optimum. Moraglio also defined the GSM operator, which corresponds to geometric mutation (box mutation) on the semantic space [12,26] Geometric Semantic Mutation (GSM). Given a parent function 𝑇:R𝑛→R , GSM with mutation step 𝑚𝑠 returns the real function 𝑇𝑀=𝑇+𝑚𝑠 ·(𝑇𝑅1−𝑇𝑅2) , where 𝑇𝑅1 and 𝑇𝑅2are random real functions. The ms is used to tune the proportion of the perturbation (i.e., the limits of the box). Overall, GSGP have the ability to introduce a unimodal fitness landscape on the training set since genetic operations can always produce offspring that are closer to the target. This is phenomenon renders regression and classification problems easy to solve on training set. Figure 2.10: Tree representation of the GSM formula. (Inspired from [34]) 15
CHAPTER 2. THEORETICAL BACKGROUND 2.3.2.5 Real-Life Applications of GSGP GSOs, in addition to presenting a unimodal fitness landscape, had some limitations that rendered them useless in practice when they were first introduced. By their definitions, GSOs were causing the representation of the offspring to become larger for every generation. For future works, Moraglio suggested simplifying the syntax of the individuals to obtain a simpler genotype while preserving their semantics. Vanneschi et al. and Castelli et al. presented a novel implementation that made GSGP utilizable for complex real-life applications, for the first time [13,45]. 2.3.3 GSGP Implementation This novel implementation of Vanneschi et al. [45] is based on saving new generation records that include operators and parents. As in standard GP, it begins by generating a random initial population. The individuals’ representations and semantics are then stored in two tables. A new table is created for each new generation of individuals 𝑇 . The table contains information about the operator with which the individual was created (crossoveror mutation), as well as the ID. The ID is a memory pointer(reference) of the parents and their semantics, which were calculated using geometric semantic operators. Individuals from the new population are also saved in this manner. An individual created by a crossover between parents 𝑇1 and 𝑇2 is represented by the triplet 𝑇=<𝐼𝐷(𝑇1), 𝐼𝐷(𝑇2), 𝐼𝐷(𝑅)> , where R is the random tree used by the crossover. With the same form, an individual created by a mutation operator on 𝑇2 is represented as 𝑇=<𝐼𝐷(𝑇2), 𝐼𝐷(𝑅1), 𝐼𝐷(𝑅2)> where 𝑅1 and 𝑅2 are random trees. Random trees, along with their representations and semantics, must also be stored on a table. Figure 2.11: Illustration of the example described above. (a) The initial population 𝑃 ; (b) The random trees used by crossover; (c) The representation in memory of the new population 𝑃′. (Reprinted from [45]) Since the trees are stored with their semantics (evaluations), there is no need to explicitly buildthe tree and evaluate the entire tree afterthe creation of an offspring. Due to memory constraints, individuals that are not used for the creation of any offspring are deleted from the memory before passing on to the next generation because they will never be used again. 16
2.4. LINEAR SCALING In terms of time complexity, this method is linear with respect to population size and the number of generations since it requires 𝑂(𝑛) space to store the individuals for g number of generations ( 𝑂(𝑛𝑔) ). At the end, it is sufficient to reconstruct the best individual making reconstruction a one-time process and it can be done offline from the algorithm. Overall, this novel implementation ensures GSGP to be applied efficiently on real-life data with high success rates. 2.4 Linear Scaling While performing regression with GP, in cases where individuals that have a shape which is very similar to the one of the target functions, many solutions may receive a bad fitness value due to having different slope and/or being located in a distant position of the Cartesian space. LS was introduced by Keijzer to tackle this issue and improve the performance of GP on symbolic regression [6]. It is a method introduced to facilitate the task of GP of searching for the best function matching a set of known data. LS modifies the fitness function in a very simple way, rescaling each individual by using their slope and intercept, two constants that can be easily calculated with a cost that is linear in the size of the training set. Let 𝑃(𝑥𝑖) be the output of GP individual 𝑃 on the 𝑖th observation of the training set. A linear regression on the target values 𝑡 can be performed using the equations: 𝑏= 𝑛 Õ 𝑖=1h𝑡𝑖−𝑡𝑃(𝑥𝑖)−𝑃i 𝑛 Õ 𝑖=1𝑃(𝑥𝑖)−𝑃2 𝑎=𝑡−𝑏 𝑃 (2.1) where 𝑛 is the number of training observations (fitness cases) and 𝑃 and 𝑡 denote the average output and the average target value respectively. Values 𝑏 and 𝑎 respectively calculate the slope and intercept of the set of outputs 𝑃(𝑥𝑖) , such that the sum of the squared errors between 𝑡 and 𝑎+𝑏𝑃 is minimized. After this, any error measure can be calculated on the scaled formula 𝑎+𝑏𝑃, for instance the RMSE: RMSE(𝑡, 𝑎 +𝑏 𝑃)= v u u u u t 𝑛 Õ 𝑖=1(𝑎+𝑏 𝑃(𝑥𝑖)−𝑡𝑖)2 𝑛(2.2) 17
CHAPTER 2. THEORETICAL BACKGROUND If a is different from 0 and b is different from 1, the procedure outlined above is guaranteed to reduce the RMSE for any formula [6]. By efficiently calculating the slope and intercept for each individual, the burden of searching for these two constants is thus removed from the evolution. GP is then free to search for the expression whose shape is most similar to that of the target function. 18
4 Methodology This chapter outlines the methodology employed in this study, which seeks to investigate a system that combines the aforementioned benefits of both GSGP and LS. Specifically, the system utilizes GSOs to explore the search space, while guided by the LS fitness function. The system is referred to as GSGP-LS. The general layout of the library is explained in Section 4.1, followed by a detailed discussion of the library’s various classes. The chapter follows by defining the most comprehensive class, GSGP, in Section 4.2. The Population class is discussed in Section 4.3, which includes relevant processes such as initialization, offspring creation, and population scoring in Subsections 4.3.1,4.3.2, and 4.3.3, respectively. The Individual class is discussed in Section 4.4, which includes a subsection on reconstruction in Subsection 4.4.1. The chapter concludes with the presentation of the Node class in Section 4.5. 4.1 General Organization of the GSGP-LS Library A GSGP algorithm is developed with the following system requirements: •LS can be implemented. •It is possible to solve both regression and classification problems. •Hyperparameters are easily changeable for different datasets. •Visualization of experiment results can be drawn. •An acceptable runtime is ensured. The extensibility of the library was a consideration during its design, with the intention of facilitating future research and development. The following subsections will elaborate on the library’s architecture and entities. The library was constructed based on the theoretical knowledge that was previously presented. It can perform training of GSGP models, reconstructing the representation of the best individual, running trained models for predicting, obtaining statistical results and visualizations. The code is written in Python programming language. Python has an active usage among the data science community. It contains libraries for easy data reading as well 23
CHAPTER 4. METHODOLOGY as common statistical analysis tools. It also has a high prototyping speed, all in all providing ease of development. The library comprises a diverse set of classes and functions pertaining to the GSGP algorithm. Moreover, it incorporates functions and helper classes that enable the handling of dataset reading, basic statistical operations, graphing related code, multiprocessing support, and other utility functionality that lacks scientific relevance. The library’s design embodies an entity-based object-oriented approach, whereby several modules listed herein implement a singular theoretical concept. The relevance between the entities and the theoretical concepts is shown in the table presented below. Commencing with the most comprehensive entity, the GSGP, the subsequent subsections introduce the Population, Individual, and Node. Table 4.1: GSGP Entities Theory Library An Optimization Problem GSGP A Tiny Sample of the Solution Space Population A Single Solution Individual Tree Representation Node 4.2 GSGP A GSGP problem is represented through the GSGP class, which encompasses the training and prediction procedures and features real-time reporting during the training process. The user-defined hyperparameters that are intrinsic to the GSGP algorithm are incorporated in this class. The hyperparameters, their respective definitions, and the ranges within which they are defined are comprehensively listed below. The following chapter will present the specific values that have been selected for these hyperparameters along with their corresponding justifications. Table 4.2: GSGP Parameter Definitions Parameter Definition Data Type and Range max_iter Number of generations integer pop_size Population size integer f_selection Selection method string (’tournament’) tournament.size: integer elitism_size Number of elites integer f_fitness Fitness function string (’rmse’ or ’fscore’) prob_xo Crossover probability float [0,1] prob_mut Mutation probability float [0,1] mutation_step Mutation step float for random_mutation_step: lower_range, upper_range: float 24
4.3. POPULATION To train the GSGP model, this class invokes the operation to initialize a population, then continues the process by recording statistical information such as the training fitness and test fitness of each generation (fitness over time) as well as predictions made with the best individual. The general process differs depending on whether the problem type is regression or classification. The following sections will explore these differences in detail. The GSGP class uses the following modules to test and train the GSGP model. 4.3 Population Population class represents a group of individuals, and it manages operations associated with the creation of initial and new generations. It invokes the initialization function, performs the procedure of evolving a population by creating a new generation. Furthermore, the class scores a population by calculating its average fitness, also keeping the record of the population’s fittest individual. Since the prediction requires knowledge of the best individual in any given generation, user calls via GSGP are routed to this class, which then computes the necessary predictions. It is crucial to note a distinction between regression and classification problems in this step. In classification problems, predictions are normalized using a sigmoid function, which confines the predictions to a range of 0 to 1. After normalization, a threshold value of 0.5 is utilized to classify the predictions, with those above 0.5 assigned to target class 1 and those below 0.5 assigned to target class 0. 4.3.1 Initialization Initialization of a new population is performed by creating an initial population (represented as T population) with a given size for a population, pop_size. A simple pool of random trees (represented as R population) of the same size is also created at this class. The pseudo-code of initialization algorithm is presented below. Algorithm 1 Initialize a new population 1: function rhh(𝑔𝑟𝑜𝑢𝑝_𝑠𝑖𝑧𝑒,𝑡𝑟𝑒𝑒_𝑑𝑒𝑝𝑡ℎ𝑠) 2: for all 𝑑𝑒𝑝𝑡ℎ𝑠 in 𝑡𝑟𝑒𝑒_𝑑𝑒𝑝𝑡ℎ𝑠 do 3: 𝑖←0 4: while 𝑖≤𝑔𝑟𝑜𝑢𝑝_𝑠𝑖𝑧𝑒 do 5: Append the population with an individual initialized with grow method 6: and having a current depth equals to 𝑑𝑒𝑝𝑡ℎ𝑠 7: Append the population with an individual initialized with full method 8: and having a current depth equals to 𝑑𝑒𝑝𝑡ℎ𝑠 9: 𝑖+=2 10: end while 11: end for 12: end function 25
CHAPTER 4. METHODOLOGY 1: function Initialize First Generation(𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛, 𝑑𝑎𝑡𝑎) 2: Create an empty 𝑡_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 3: Create an empty 𝑟_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 4: 𝑡𝑟𝑒𝑒_𝑑𝑒𝑝𝑡ℎ𝑠 ← [2,3,4,5,6] 5: 𝑔𝑟𝑜𝑢𝑝_𝑠𝑖𝑧𝑒_𝑜 𝑓 _𝑡_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 ← Half of the t_population_size divided by the 6: number of 𝑡𝑟𝑒𝑒_𝑑𝑒𝑝𝑡ℎ𝑠 7: 𝑔𝑟𝑜𝑢𝑝_𝑠𝑖𝑧𝑒_𝑜 𝑓 _𝑟_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 ← Half of the r_population_size divided by the 8: number of 𝑡𝑟𝑒𝑒_𝑑𝑒𝑝𝑡ℎ𝑠 9: Append 𝑡_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 with 𝑅𝐻𝐻(𝑔𝑟𝑜𝑢𝑝_𝑠𝑖𝑧𝑒_𝑜 𝑓 _𝑡_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛, 𝑡𝑟𝑒𝑒_𝑑𝑒𝑝𝑡ℎ𝑠) 10: Append 𝑟_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 with 𝑅𝐻𝐻(𝑔𝑟𝑜𝑢𝑝_𝑠𝑖𝑧𝑒_𝑜 𝑓 _𝑟_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛, 𝑡𝑟𝑒𝑒_𝑑𝑒𝑝𝑡ℎ𝑠) 11: for all individuals in 𝑡_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 do 12: Calculate initial semantics 13: end for 14: for all individuals in 𝑟_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 do 15: Calculate initial semantics 16: end for 17: end function 4.3.2 Offspring Creation During the offspring creation process, the Population class also performs the calculation of the semantics for the T population and R population, which are then stored in individuals. As shown in the pseudo-code of the evolution process below, the process starts with the selection of two parents using a given selection method, f_selection. Subsequently, a new individual is created probabilistically using one of three different methods - mutation, crossover, or replication - based on an independent random variable, with the probabilities determined by prob_xo and prob_mut. Finally, the semantics of the offspring are computed using those of its parents. 26
4.3. POPULATION Algorithm 2 Generation of a new generation 1: function Create New Generation(population) 2: Create an empty list 𝑛𝑒𝑤_𝑔𝑒𝑛𝑒𝑟𝑎𝑡𝑖𝑜𝑛 3: 𝑛𝑢𝑚𝑏𝑒𝑟_𝑜 𝑓 _𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙𝑠_𝑡𝑜_𝑐𝑟𝑒𝑎𝑡𝑒 ←𝑔𝑒𝑡_𝑝𝑜𝑝_𝑠𝑖𝑧𝑒(𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛) 4: 𝑛𝑢𝑚𝑏𝑒𝑟_𝑜 𝑓 _𝑒𝑙𝑖𝑡𝑒𝑠 ←𝑔𝑒𝑡_𝑛𝑢𝑚𝑏𝑒𝑟_𝑜 𝑓 _𝑒𝑙𝑖𝑡𝑒𝑠(𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛) 5: if 𝑛𝑢𝑚𝑏𝑒𝑟_𝑜 𝑓 _𝑒𝑙𝑖𝑡𝑒𝑠 ≥1then 6: 𝑛𝑢𝑚𝑏𝑒𝑟_𝑜 𝑓 _𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙𝑠_𝑡𝑜_𝑐𝑟𝑒𝑎𝑡𝑒−=𝑛𝑢𝑚𝑏𝑒𝑟_𝑜 𝑓 _𝑒𝑙𝑖𝑡𝑒𝑠 7: Copy elites to the 𝑛𝑒𝑤_𝑔𝑒𝑛𝑒𝑟𝑎𝑡𝑖𝑜𝑛 8: end if 9: for iin [0...number_of_individuals_to_create] do 10: Select parents 𝑇1and 𝑇2from 𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 11: 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡_𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 ←𝑟𝑎𝑛𝑑𝑜𝑚_𝑢𝑛𝑖 𝑓 𝑜𝑟𝑚(0,1) 12: if 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡_𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 ≤𝑔𝑒𝑡_𝑥𝑜_𝑝𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦(𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛)then 13: Get a random individual 𝑅from 𝑟_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 14: 𝑛𝑒𝑤_𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 ←𝑥𝑜(𝑇1, 𝑇2, 𝑅) 15: else if 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡_𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 ≤𝑔𝑒𝑡_𝑥𝑜_𝑝𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦(𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛) + 𝑔𝑒𝑡_𝑚𝑢𝑡_𝑝𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦(𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛)then 16: Get random individuals 𝑅1and 𝑅2from 𝑟_𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 17: 𝑛𝑒𝑤_𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 ←𝑚𝑢𝑡𝑎𝑡𝑖𝑜𝑛(𝑅1, 𝑅2, 𝑇1) 18: else 19: 𝑛𝑒𝑤_𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 ←𝑇1 20: end if 21: Append 𝑛𝑒𝑤_𝑔𝑒𝑛𝑒𝑟𝑎𝑡𝑖𝑜𝑛 with 𝑛𝑒𝑤_𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 22: end for 23: return 𝑛𝑒𝑤_𝑔𝑒𝑛𝑒𝑟𝑎𝑡𝑖𝑜𝑛 24: end function 4.3.3 Scoring a Population As the Population class is responsible for all individuals in the system, it also scores the current generation. The ordering of individuals varies based on the fitness function being utilized. Values closerto 1 indicate superiorfitness forF1 score, while values closer to 0 indicate superior fitness for RMSE. To ensure that the library remains extensible, the fitness functions class must conform to the protocol of the fitness function. This is accomplished by sub-classing the abstract class of fitness functions and implementing the requisite methods. Any fitness function that adheres to this protocol can be utilized 27
CHAPTER 4. METHODOLOGY to generate scoring, as shown in the pseudo-code below. If the current individual is very decisive on a particular output, a bad fitness (very low or very high depending on the fitness function) score is assigned to that individual, as in Keijzer’s paper [6]. The library is designedto operate withorwithout LS forcomparability. As presented in the pseudocode, if the LS option is selected, a and b are calculated and the results are scaled according to the method outlined in Chapter 2, Theoretical Background. Algorithm 3 Fitness calculation 1: function Score Current Generation(𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛,𝑑𝑎𝑡𝑎) 2: for all individuals in population do 3: for all rows in data do 4: Get target value 5: Get evaluation using semantics 6: 𝑟𝑜𝑤_𝑟𝑒𝑠𝑢𝑙𝑡𝑠 ←𝑡𝑢𝑝𝑙𝑒(𝑡𝑎𝑟𝑔𝑒𝑡, 𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑖𝑜𝑛) 7: end for 8: 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 ←𝑐𝑎𝑙𝑐𝑢𝑙𝑎𝑡𝑒_𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒(𝑟𝑜𝑤_𝑟𝑒𝑠𝑢𝑙𝑡𝑠) 9: if 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 ≥107or 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 ≤10−7then 10: Assign a bad fitness value 11: else 12: if 𝐿𝑖𝑛𝑒𝑎𝑟 𝑆𝑐𝑎𝑙𝑖𝑛𝑔 then 13: 𝑎, 𝑏 ←𝑐𝑎𝑙𝑐𝑢𝑙𝑎𝑡𝑒_𝑙𝑖𝑛𝑒𝑎𝑟_𝑠𝑐𝑎𝑙𝑖𝑛𝑔_𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝑠(𝑟𝑜𝑤_𝑟𝑒𝑠𝑢𝑙𝑡𝑠) 14: 𝑟𝑜𝑤_𝑟𝑒𝑠𝑢𝑙𝑡𝑠 ←Scaled results 15: end if 16: Calculate average fitness 17: end if 18: Assign the fitness value to the individual 19: end for 20: Sort population with respect to the fitness values 21: return Individual with the best fitness 22: end function 28
4.4. INDIVIDUAL 4.4 Individual Individual class represents an individual (i.e., a single solution to the problem). The class performs the mutation and crossover by taking an instance of an individual and returning the mutated individual or an offspring. GSC and GSM formulas used in this class are consistent with those outlined in the literature [12]. 4.4.1 Reconstruction It should be noted that a modified technique, distinct from the one presented in Chapter 2, has been studied to ensure the reconstruction capability. This technique leverages Python’s garbage collection mechanism, which functions by keeping track of reference count - a counter that holds the number of references made for an object. Essentially, a Python variable is a reference to an object stored in memory. When the reference count of an object reaches zero, indicating that the object is no longer referred to by any variable, the garbage collector promptly removes it. In this algorithm, each individual is represented by a tree structure. When an offspring is created in the Individual class, the crossover or mutation operation is performed with the parent’s or a random tree’s representation. Consequently, the tree representation of the offspring only contains references to the parent or the random tree, rather than the entire tree structure. Python’s reference counting and garbage collection mechanism ensure that memory is periodically cleaned up, and any unused representations are erased from memory. In the creation of a new population, any individuals that were not used are erased. As the tree grows, each node contains a recursive method, which can make the recursion memory-intensive, resulting in slower performance and limitations in terms of the number of nodes. This approach was implemented to investigate its potential, but it has its limitations. However, since the focus of this study is not on reconstruction, and this method is not required for experimental purposes, exploring ways to address these limitations is intriguing for future research. 4.5 Node Node holds the data structure that objectifies a node in a tree representation. As outlined in the theory, each tree is constructed by combining individual nodes, and the Node structure is used to instantiate each node. To compute initial semantics for a tree, the evaluate function is called on this data structure. Although the semantics of a node can still be calculated with the evaluate function as the tree and data structure grow, it is preferable for computation time reasons to use the semantics of the parents without reevaluating them. Values for the nodes are selected from a function set and a terminal set. The function set comprises four binary operations: addition, subtraction, multiplication, 29
CHAPTER 4. METHODOLOGY and division, implemented in Node. Division is defined as a protected division to avoid division by zero scenarios. Specifically, the division operation is performed only if the denominator is not zero; otherwise, the result is 1.To introduce non-linearity to the function set, several additional operations have been defined, including square root, negative x, sine, cosine, absolute value, reciprocal (1/x), exponential, and logarithm. These operations can be selected for use if needed. Terminal nodes are randomly selected from the available columns in the dataset’s features. Additionally, terminal nodes can be expanded to include random numbers if desired by the user. In accordance with the theoretical details, the RHH initialization method is also implemented in this section. The initialization process can be performed by RHH, full, or grow methods. 30
5 Experimental Study This chapter presents the findings of the application of the methodology introduced in the previous chapter, along with accompanying experimental studies. To facilitate reproducibility, the experimental setup is outlined in Section 5.1. Subsection 5.1.1 includes parameter setting and Subsection 5.1.2 outlines case studies on regression, synthetic and classification datasets. The associated experimental results for all problems are given in 5.2 with separate subsections for regression experiments 5.2.1, synthetic dataset experiments 5.2.2 and classification experiments 5.2.3. Ultimately, the results are discussed in Section 5.3. 5.1 Experimental Setup The objective of this work is to assess the effectiveness of integrating the LS technique with the GSGP algorithm. To this end, multiple experiments were conducted using both regression and classification problems. For each problem, the experiments were repeated using the GSGP alone and in combination with LS. Each configuration was implemented using the library presented in the Chapter 4. Given the non-deterministic nature of the GSGP algorithm, with elements of randomness present in the initialization, evolution, mutation, crossover, and parent selection steps, the outcome of a single run is not considered reliable for comparison purposes. To obtain more accurate results, multiple independent runs of the algorithm were performed. 60 independent runs were conducted for each configuration, with the dataset randomly partitioned into 70% training and 30% test sets for each run. 5.1.1 Parameter Settings It is worth noting that the primary focus of this work was not on optimizing hyperparameters but rather on making a fair comparison between the two approaches. In addition, optimizing hyperparameters would probably give origin to a different hyperparameter set for every case, thus generating a disorder. As such, the hyperparameters 31
CHAPTER 5. EXPERIMENTAL STUDY •EM: MSCI emerging markets index. •TL BASED ISE: Istanbul stock exchange national 100 index. Table 5.6: Attributes of Istanbul Stock Exchange. Type Min. Max. Avg. Med. SD SP float -0.054 0.068 0.001 0.001 0.014 DAX float -0.052 0.059 0.001 0.001 0.015 FTSE float -0.055 0.05 0.001 0.0 0.013 NIKKEI float -0.05 0.061 0.0 0.0 0.015 BOVESPA float -0.054 0.064 0.001 0.0 0.016 EU float -0.049 0.067 0.0 0.0 0.013 EM float -0.039 0.048 0.001 0.001 0.011 TL BASED ISE float -0.062 0.069 0.002 0.002 0.016 Human Oral Bioavailability The dataset serves as a complex, real-world application in the field of pharmacokinetics. It involves forecasting the human oral bioavailability of a set of potential new drug compounds based on a set of molecular descriptors [88]. Human oral bioavailability, indicated by %F, is the parameter that measures the percentage of the initial orally administered drug dose that effectively reaches systemic blood circulation after passing through the liver. Each instance is a vector of molecular descriptor values identifying a candidate new drug and each column represents a molecular descriptor. The target is the human oral bioavailability, %F. The distribution of %F is plotted in Figure 5.2b. The attributes have not been detailed because of the large quantity and this will remain the same for the subsequent regression datasets. (a) Istanbul Stock Exchange (b) Human Oral Bioavailability (c) LD50 Figure 5.2: Histogram of the target columns. 38
5.1. EXPERIMENTAL SETUP Median Oral Lethal Dose: LD50 The dataset being studied, which is drawn from the field of pharmacokinetics, concerns the prediction of the median lethal dose of a molecular compound [7]. This is a widely used metric for evaluating the toxicity of drugs. The acronym LD stands for Lethal Dose, and the term LD50 refers to the amount of a substance, administered in one dose, that results in the death of 50% of a group of test animals. Each data point consists of a vector representing a molecular compound, with the corresponding target being the LD50 value. The distribution is depicted in Figure 5.2c Plasma Protein Binding Levels: PPB This dataset, from the field of pharmacokinetics, aims to predict the percentage of the initial drug dose that binds to plasma proteins [7]. This measure is of paramount importance as it relates to the distribution of drugs within the body and their ability to reach their intended target. The instances consist of vectors representing molecular compounds, with the corresponding PPB value serving as the target. The distribution of these values is plotted in Figure 5.3a. Docking Energy The dataset in question, belonging to the field of drug discovery and design, aims to predict the interaction energy between a candidate drug and its target tissue [83]. This metric, known as docking energy, quantifies the strength of binding between the molecules of the drug and those of the target. Each data point consists of a vector representing a molecular compound, with the corresponding target being the docking energy and the distribution is shown in Figure 5.3b. Fludarabine The dataset is used to predict the response of a set of cancer patients to the pharmacologic of the Fludarabine drug [89]. It was built looking for a functional relationship between gene expressions and responses to the Fludarabine. Each instance represents a gene expression and the features are the expression level of one particular gene. Target is the therapeutic response to the drug. The distribution of its values is illustrated in Figure 5.3c. 39
CHAPTER 5. EXPERIMENTAL STUDY (a) PPB (b) Docking Energy (c) Fludarabine Figure 5.3: Histogram of the target columns. 5.1.2.2 Synthetic Datasets As previously stated in Chapter 3, Keijzer demonstrated a significant enhancement in the performance of GP in symbolic regression through the integration of LS, as presented in his paper [6]. He carried out a set of experiments to illustrate the practical benefits of utilizing LS. In order to eliminate any biases that may arise from an arbitrary definition of testing functions, he used problems that have been sourced from previous research that are relevant to the application and enhancement of symbolic regression. Besides being a good scientific practice to test a method (in this study, LS) on the same case studies that were used in the work that introduced that method, motivations for choosing these benchmarks are the same as in [6], i.e.: “many of the problems above mix trigonometry with polynomials, or make the problems in other ways highly non-linear”. Also, it is relevant to point out that, as stated in [6], “being of low dimensionality does not make the problems easy however”. The specifics regarding the sampling approach and other problem-specific details are presented in Table 5.7. The problem names are kept the same as the paper. The datasets were hand-tailored according to these specifics. The training and testing intervals are indicated using the [start:step:stop] notation when the set is constructed with systematic intervals. The rnd(min,max) notation symbolizes random sampling within a specified range, while the mesh ([start:step:stop]) notation signifies regular sampling in two-dimensional space. 40
5.1. EXPERIMENTAL SETUP Table 5.7: Synthetic dataset settings. Problem Equation range (train) range (test) 4𝑓(𝑥)=𝑥3𝑒𝑥𝑝−1𝑐𝑜𝑠(𝑥)𝑠𝑖𝑛(𝑥)(𝑠𝑖𝑛2(𝑥)∗ 𝑐𝑜𝑠(𝑥)−1)[0:0.05:10] [0.05:0.05:10.05] 5𝑓(𝑥, 𝑦, 𝑧)=30𝑥𝑧 (𝑥−10)𝑦2x,z = rnd(-1,1) [0:0.05:10] y = rnd(1,2) [0:0.05:10] 6𝑓(𝑥)=Í𝑥 𝑖1/𝑖[1:1:50] [1:1:120] 7𝑓(𝑥)=𝑙𝑜𝑔𝑥 [1:1:100] [1:0.1:100] 8𝑓(𝑥)=√𝑥[0:1:100] [0:0.1:100] 9𝑓(𝑥)=𝑎𝑟𝑐𝑠𝑖𝑛ℎ(𝑥)[0:1:100] [0:0.1:100] 5.1.2.3 Classification Datasets For this section of the study, three different classification problems were considered. Table 5.8 provides the number of instances and attributes for each dataset as well as the ratio of target classes. The Banknote Authentication Dataset, created with authentic and forged banknote images, was chosen for its widespread use in binary classification analysis in the data science community. The Spotify Funk Songs dataset is a dataset that was established with colleagues several years ago, involving songs extracted from several playlist. Finally, Breast Cancer Wisconsin (Diagnostic) dataset contains predictions on breast mass images. It is widely utilized in numerous ML and GP studies. Table 5.8: Classification Datasets. Instances Class Ratio Attributes (class -1: class 1) Banknote Authentication 1372 762 : 610 5 Spotify Funk Songs 985 711 : 274 14 Breast Cancer Wisconsin (Diagnostic) 569 357 : 212 31 Banknote Authentication This dataset is used to differentiate between authentic and forged banknotes. The dataset was sourced from the UCI ML repository and is credited to Volker Lohweg of the University of Applied Sciences as the owner, with Helene Darksen also of the University of Applied Sciences credited as the donor [90]. Images acquired from authentic and forged banknote-like specimens were used to extract data. An industrial camera is used for digitization. To extract features from images, Wavelet Transform tool were used. A Wavelet Transform can be used to represent the image as a sum of different frequency sub-bands which is useful for feature extraction. The resulting image is a set of coefficients that represent the different frequency components of the image. The features are the variance, skewness, curtosis of the Wavelet Transformed image and the entropy of the image. Their characteristics are summarized in Table 5.9. The target value is -1 for authentic banknotes and 1 for the forged banknotes. 41
CHAPTER 5. EXPERIMENTAL STUDY Table 5.9: Attributes of Banknote Authentication. Type Min. Max. Avg. Med. SD variance float -7.0 6.8 0.4 0.5 2.8 skewness float -13.8 13.0 1.9 2.3 5.9 curtosis float -5.3 17.9 1.4 0.6 4.3 entropy float -8.5 2.4 -1.2 -0.6 2.1 class int -1.0 1.0 -0.1 -1.0 1.0 Spotify Funk Songs The dataset comprises songs from fifteen distinct playlists featuring various genres on Spotify, one of the largestaudio streaming service providers. The playlists encompass diverse themes such as funky jams, heavy metal, romantic ballads, and relaxing piano. The platform, named Spotify For Developers, enables developers to extract detailed information about albums, tracks, and playlists. The dataset was established by me and my colleagues for an ML project aimed at predicting suitable songs for a funk band [91]. The attributes of the dataset are elaborated below and a statistical summary has been provided in Table 5.10. The songs can be classified according to the target column, which is binary in nature. If the song belongs to a playlist related to the funk genre, it is labeled as 1, and -1 otherwise. •danceability: How suitable a track is for dancing. •energy: Represents a perceptual measure of intensity and activity. •key: The estimated overall key of the track. •loudness: The overall loudness of a track in decibels. •mode: Modality (major or minor) of the track. •speechness: Presence of spoken words in a track. •acousticness: A measure indicating the level of acousticness. •instrumentalness: Measures the level of instrumentalness (no vocals). •liveness: Detects the presence of an audience in the recording. •valence: Describes the musical positiveness conveyed by a track. •tempo: The overall estimated tempo of a track in beats per minute (BPM). •duration_ms: The duration of the track in milliseconds. • time_signature: An estimated overall time signature (beats per measure) of a track. 42
5.1. EXPERIMENTAL SETUP Table 5.10: Features of Spotify Funk Songs Type Min. Max. Avg. Med. SD danceability float 0.0 0.9 0.5 0.5 0.2 energy float 0.0 1.0 0.5 0.4 0.3 key int 0.0 11.0 5.2 5.0 3.6 loudness float -43.9 -1.9 -14.2 -11.6 8.6 mode int 0.0 1.0 0.7 1.0 0.5 speechiness float 0.0 0.8 0.1 0.0 0.1 acousticness float 0.0 1.0 0.5 0.5 0.4 instrumentalness float 0.0 1.0 0.4 0.1 0.4 liveness float 0.0 1.0 0.2 0.1 0.1 valence float 0.0 1.0 0.4 0.3 0.3 tempo float 0.0 211.3 116.1 112.8 31.6 duration_ms int 62693.0 1215573.0 253833.2 229360.0 125928.2 time_signature int 0.0 5.0 3.8 4.0 0.5 target int -1.0 1.0 -0.4 -1.0 0.9 Breast Cancer Wisconsin (Diagnostic) The dataset comprises instances of digital images of fine needle aspirates (FNA) of breast masses [92]. Fine-needle aspiration is a diagnostic procedure employed to investigate lumps or masses. This technique involves the insertion of a thin, hollow needle into the mass to obtain a sample of cells, which, upon being stained, are subsequently examined under a microscope. The features of the dataset describe the characteristics of the cell nuclei present in the images. For each cell nucleus, there are 10 features with float data type: •radius (mean of distances from center to points on the perimeter) •texture (standard deviation of gray-scale values) •perimeter •area •smoothness (local variation in radius lengths) •compactness (𝑝𝑒𝑟𝑖𝑚𝑒𝑡𝑒𝑟2/𝑎𝑟𝑒𝑎 −1.0) •concavity (severity of concave portions of the contour) •concave points (number of concave portions of the contour) •symmetry •fractal dimension ("coastline approximation" - 1) The mean, standard error, and "worst" or largest (mean of the three largest values) of these features were computed for each image, resulting in 31 attributes in total with the target. The extensive number of attributes has led to the decision to not display the statistical summary for each one. The target is the diagnosis which is classified as -1 for benign cases and 1 for malignant cases. 43
CHAPTER 5. EXPERIMENTAL STUDY 5.2 Experimental Results 5.2.1 Regression Experiments The following figures from 5.4 to 5.18 display the performance of the GSGP and GSGPLS algorithms on both the training and test sets for the nine considered regression datasets. The median fitness, measured in terms of RMSE, of the best individual is plotted against the generation number for each configuration, based on the results of 60 independent runs. The median was chosen over the mean as it is more robust to outliers, providing a more reliable representation of the data. From the Figures 5.4,5.7,5.12, it can be deduced that GSGP-LS consistently outperforms GSGP on the training set for all considered problems. Concerning the results on the test set, it can be noticed from the Figure 5.4 that GSGP-LS outperforms GSGP on three of the considered problems: •Boston Housing (Boston) •Concrete Compressive Strength (Concrete) •Unified Parkinson’s Disease Rating Scale (Parkinson) Nevertheless, as it can be observed in Figures 5.7 and 5.12, GSGP-LS suffers from overfitting issues on six of the considered problems: •Istanbul Stock Exchange (Istanbul) •Human Oral Bioavailability (Bioavailability) •Median Oral Lethal Dose: LD50 (LD50) •Plasma Protein Binding Levels: PPB (PPB) •Docking Energy (Docking) •Fludarabine (Fludarabine) To assess the statistical significance of these results Mann-Whitney U test with statistical significance at 𝛼= 0 . 05 was performed for both training and test sets, for each problem, at each generation, with the null hypothesis that the distribution of the RMSE of the best individual originated from the 60 runs is the same for GSGP and GSGP-LS. The results of comparing the two algorithms on the training set are deemed statistically significant, as indicated by consistently low 𝑝 -values of approximately 10 −12 . The 𝑝 -values are reported in Figures 5.6,5.9,5.11. The evolution of the 𝑝 -value resulting from the comparison of the two algorithms on the test set is reported in Figures 5.5, 5.8,5.10. The significance threshold in each plot is also shown by red horizontal line at 0.05. The results of the test set for the Boston, Concrete, and Parkinson datasets, as illustrated in Figure 5.4, provide robust evidence of the superiority of GSGP-LS over GSGP. The decline in the RMSE is not significant for GSGP-LS, as it commences from a 44
5.2. EXPERIMENTAL RESULTS much lower RMSE value. It is noteworthy to consider that these datasets possess a high ratio of instances to attributes and have been extensively studied, without any reported tendency to overfit. The 𝑝 -value plots in Figures 5.5,5.6 consistently demonstrate a value near zero, supporting the aforementioned observation. Figures 5.7,5.12 demonstrate clear overfitting for all datasets it demonstrates. The Bioavailability and PPB datasets share a characteristic on the test set: despite GSGPLS starting from a lower value, it begins to increase and results in a poorer model, whereas this trend is not observed for the GSGP algorithm. The increase is more subtle in the case of Bioavailability and more pronounced in PPB. The possible causes are discussed in Subsection 5.3. Even though the 𝑝 -values in Figure 5.8,5.10 being below the threshold, this is due to the lines not having converged yet. PPB is not the only dataset exhibiting a noticeable increase in RMSE. The LD50 and Fludarabine datasets also demonstrate similar characteristics, starting from a low RMSE and then increasing to a level even higher than that of GSGP. As a result, their 𝑝 -values are initially close to zero but eventually exceed the threshold. While this does not directly cause overfitting, it is worth noting that these three datasets share a critical aspect: they all have a very low ratio of instances to attributes. Istanbul and Docking does not suffer from low instance to attribute ratio but it can be observed that GSGP-LS cannot show a superior performance. It converges with GSGP and remains stagnant for many generations with Docking. Although it initially begins with a lower RMSE, the two methods have a comparable performance with Istanbul. For both, the 𝑝 -value starts from a value close to zero, then gradually increases as the two methods start to have comparable performance and eventually the 𝑝 -value starts to decline after about 400-450 generations. Then, GSGP starts performing better and RMSE starts increasing with GSGP-LS algorithm. The fact that the GSGP-LS error curves on the test set for Bioavailability, LD50, PPB and Fludarabine are increasing since the very first generations should also be noticed. The analysis and discussion on the matter is deepened in Subsection 5.3. Lastly, it is interesting to notice that, for both training and test sets, the initial RMSE of GSGP-LS is already lower than that at the end of evolution for standard GSGP. On the training set, this outcome was expected, given the known benefits of LS on the initial population [6]. 45
CHAPTER 5. EXPERIMENTAL STUDY Figure 5.4: Results of the experimental comparison between GSGP and GSGP-LS with Boston, Concrete and Parkinson datasets. Figure 5.5: Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test data for Boston, Concrete and Parkinson datasets. 46
5.2. EXPERIMENTAL RESULTS Figure 5.6: Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on training data for Boston, Concrete and Parkinson datasets. Figure 5.7: Results of the experimental comparison between GSGP and GSGP-LS with Istanbul, Bioavailability, LD50 datasets. 47
CHAPTER 5. EXPERIMENTAL STUDY Table 5.11: Median Classification Report of Banknote GSGP Precision Recall F1 Score Support -1 0.948 0.943 0.932 225 1 0.929 0.932 0.915 187 Accuracy 0.925 GSGP-LS Precision Recall F1 Score Support -1 0.97 0.996 0.983 225 1 0.995 0.963 0.98 187 Accuracy 0.982 (a) GSGP (b) GSGP-LS Figure 5.19: Confusion Matrices of the best individuals of Banknote Authentication Table 5.12: Median Classification Report of Spotify Funk Songs GSGP Precision Recall F1 Score Support -1 0.925 0.95 0.933 204 1 0.88 0.821 0.835 92 Accuracy 0.904 GSGP-LS Precision Recall F1 Score Support -1 0.949 0.94 0.944 213.5 1 0.845 0.867 0.856 82.5 Accuracy 0.919 54
5.2. EXPERIMENTAL RESULTS (a) GSGP (b) GSGP-LS Figure 5.20: Confusion Matrices of the best individuals of Spotify Funk Songs Table 5.13: Median Classification Report of Breast Cancer Wisconsin GSGP Precision Recall F1 Score Support -1 0.944 0.961 0.948 105.5 1 0.936 0.899 0.915 65.5 Accuracy 0.936 GSGP-LS Precision Recall F1 Score Support -1 0.977 0.947 0.963 111 1 0.905 0.959 0.932 60 Accuracy 0.953 (a) GSGP (b) GSGP-LS Figure 5.21: Confusion Matrices of the best individuals of Breast Cancer Wisconsin 55
CHAPTER 5. EXPERIMENTAL STUDY Figure 5.22: Results of the experimental comparison between GSGP and GSGP-LS with Banknote, Spotify and Wisconsin datasets. Figure 5.23: Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test data for Banknote, Spotify and Wisconsin datasets. 56
5.3. DISCUSSION ON RESULTS Figure 5.24: Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on training data for Banknote, Spotify and Wisconsin datasets. 5.3 Discussion on Results Even though the results obtained with GSGP-LS appear generally promising, some overfitting issues were encountered in real-life problems and theoretical benchmark problems. For real-life problems, it can be observed that LS worsens the overfitting issues on the Bioavailability, LD50, PPB, Docking and Fludarabine datasets. Thus, it can be concluded that LS can induce or worsen overfitting on some problems on GSGP. Taking a closer look at these "problematic" datasets, it can be noticed that they share two aspects which make them particularly difficult for the regression task, and have even already caused some of them to be criticised in the literature [93]. First, they have a large amount of features compared to the amount of instances available (i.e., there are many more rows than columns in the dataset). And second, there are similar observations which map to different target values. For these reasons, these datasets are relatively prone to overfitting. The synthetic datasets have revealed overfitting issues on problems 4 and 5. The function of the problem 4 includes exponential, sine, and cosine functions, thus it is reasonable to surmise that the LS is struggling to accurately fit the shape of the problem. To address this issue, the experiment was repeated using a function set. To add non-linearity to the function set, the following functions were included: addition, multiplication, reciprocal, negation, square root, and sine ( {+,∗, 1 /𝑥, −𝑥, √𝑥, 𝑠𝑖𝑛(𝑥)} ). RMSE plots of the problem 4 with new function set can be observed in Figure 5.25. Additionally, 𝑝 -values of the test set is plotted in Figure 5.26. Examining the results, it can be concluded that it is worth investigating the impact of the function set. Going back to the results of regression problems, additional insights can be gained on possible ways to overcome the overfitting issue. Since the test error starts with a reasonable value and only significantly increases after some generations, as per definition of overfitting, the most trivial solution would be to stop the evolution earlier. However, deciding a proper stopping condition to tackle the problem is not 57
CHAPTER 5. EXPERIMENTAL STUDY Figure 5.25: Results of the experimental comparison between GSGP and GSGP-LS with problem_4 with the alternative function set. (a) Test Set (b) Training Set Figure 5.26: Evolution of 𝑝 -values resulting from the comparison between GSGP and GSGP-LS on test and training data for problem_4 with the alternative function set. straightforward. The simplest solution in that sense would be to introduce a validation set to simulate the error on unseen data along evolution, to detect immediately if the solution is starting to overfit. However, this strategy is only viable with large enough datasets, since it implies splitting the dataset in more parts, hence reducing the amount of observations in each. In fact, five datasets where we observed overfitting suffer from lack of instances, thus becoming not ideal candidates for this solution. A more sophisticated early stopping criterion, which seems more suitable for the datasets at hand, has been proposed in [94] to leverage the semantic information available in GSGP for deciding when to end the evolutionary optimization. Notably, such a criterion would also yield the positive side effect of improving the overall computation efficiency of the process. However, both the curves of the test set fitness of GSGP-LS are increasing since the very beginning of the run on LD50, PPB and 58
5.3. DISCUSSION ON RESULTS Fludarabine. This induces a thought: although worth investigation, early stopping may not be enough to generate reliable models in those cases. For this reason, in the Chapter 6, other strategies that should be explored in the future to limit overfitting are proposed. In the case of problem 5, a plateau in RMSE values was noted early on in the generations. This could be attributed to the division in the definition of problem 5. The division was defined in the function set as a protected division, which returned a constantvalue of 1 forcases where the denominatorwas 0. This could resultin a constant behavior for the model. The overfitting in this scenario is not due to the problem itself, but rather to the choice of protected division. The algorithm approximates the division with a value that is not the actual result of the division, which causes in a deviation from the data. As a result, the algorithm discards the good results and is unable to improve its performance. During the classification experiments, no overfitting was observed. However, an important aspect was noted regarding the use of classification and LS: the class values assigned to the targets play a crucial role in ensuring the proper functioning of the LS method. When the model used 0 and 1 as labels, it failed to correctly predict more than half of the instances of class 1, resulting in subpar performance. To comprehend the reasoning behind this, it is imperative to recall the linear scaling equations 5.1. 𝑏= 𝑛 Õ 𝑖=1h𝑡𝑖−𝑡𝑃(𝑥𝑖)−𝑃i 𝑛 Õ 𝑖=1𝑃(𝑥𝑖)−𝑃2 𝑎=𝑡−𝑏 𝑃 (5.1) where 𝑃 is a GSGP individual, 𝑃(𝑥𝑖) is the output of the individual calculated on observation 𝑥𝑖 , 𝑃 is the average output, 𝑡 is target values, 𝑡 is the average target values, 𝑎 and 𝑏 are LS constants. After calculating 𝑎 and 𝑏 , individual 𝑃 is evaluated by calculating the error of 𝑎+𝑏𝑃. The problem occurs due to the utilization of the labels 0 for the targets. Since 0 is always the minority class in the datasets used in this study, the mean of the labels, 𝑡 , will always be slightly smaller than 0.5: 𝑡+𝜖=0.5, where 𝜖 > 0 This leads to a situation where the subtraction of 𝑡𝑖 and 𝑡 will result in a value slightly higher than 0.5, leading to an approximation of 0 for 𝑏when the label is 1: 𝑡𝑖−𝑡−𝜖=0.5, where 𝜖 > 0 𝑏≈0 as 𝑎and 𝑃𝑠𝑐𝑎𝑙𝑒𝑑 are defined as: 59
CHAPTER 5. EXPERIMENTAL STUDY 𝑎=𝑡−𝑏𝑃, 𝑃𝑠𝑐𝑎𝑙𝑒𝑑 =𝑎+𝑏𝑃 a decreases to a slightly lesser value than 𝑡 and 𝑃𝑠𝑐𝑎𝑙𝑒𝑑 becomes slightly smaller than a: 𝑎+𝜖=𝑡, 𝑃𝑠𝑐𝑎𝑙𝑒𝑑 +𝜖=𝑎, where 𝜖 > 0 causing the most of the predictions for class 1 to be considered as 0. In this scenario, the use of 0 as label in the equation results in an approximately constant output. The predictions are not based on the class, but instead, arise from the inherent properties of 0 as the identity element of multiplication. To resolve this issue, the class labels were altered to -1 and 1, and subsequent experimentation revealed that the root cause was the use of 0 in the equations. 60
6 Conclusions and Future Work This final chapter of the dissertation presents a brief overview of the proposed work and summarizes the main conclusions related to Geometric Semantic Genetic Programming (GSGP) with Linear Scaling (LS). Additionally, suggestions for further research are put forward. The presented technique, referred to as GSGP, is grounded in a theoretical framework that has been thoroughly elucidated. GSGP is a variation of Genetic Programming (GP) that employs two innovative genetic operators, Geometric Semantic Operators (GSO), in lieu of the conventional crossover and mutation operators. Another technique, LS, focuses on altering the fitness of solutions without modifying the genetic operators themselves. The theoretical underpinnings of both GSGP and LS are delineated in the background section, and a detailed description of the implementation of both techniques is presented in the methodology. The effects of augmenting GSGP with LS was explored in this work. In particular, encouraged by the success that was obtained in [15], the work aimed at investigating the combination of the beneficial traits of these two methods, which can both outperform standard GP, by improving the genetic operators – for GSGP – and the fitness – for LS. The analysis involved a thorough experimental evaluation on the task of symbolic regression for six theoretical benchmarks and nine real-life problems of various difficulties besides three real-life problems from different fields for classification task. GSGP was compared against GSGP with LS (GSGP-LS), both in terms of efficiency, i.e., how fast evolution is able to achieve the desired goal, and in terms of generalization, i.e., how well the induced model is able to generalize to unseen data. The findings demonstrate substantial enhancements in most instances, both in the training and testing sets, when compared to the standard GSGP approach. Moreover, the results indicate that LS accelerates the evolutionary search process compared to GSGP. These conclusions hold for both regression and classification problems. Notably, in the classification problems, no instances of overfitting were detected, and the datasets under examination had not previously been flagged as prone to overfitting. 61
CHAPTER 6. CONCLUSIONS AND FUTURE WORK However, it was observed that the integration with LS makes GSGP more prone to overfitting when the addressed problem is characterized by particularly difficult data which was observed with regression problems. Nonetheless, from the behavior of LS during the evolution, it was concluded that search process could be stopped earlier to achieve comparable or better results than without LS, for both GP and GSGP, with the desirable side effect of saving computation time. For GSGP, the approach of early stopping based on semantic neighbourhood presented in [94] can be considered particularly promising. Besides early stopping, other methods have recently demonstrated their effectiveness in controlling overfitting. For instance, one may imagine to develop a system in which LS is turned on and off dynamically during the evolution. A similar approach has been recently presented for a suitable use of local search inside GSGP [95]. In that contribution, GSGP was enhanced with local search at the beginning of the run, but local search was later disabled, for an appropriate control of overfitting. A similar idea may let GSGP-LS to exploit the advantages of LS in the initial generations, and later the evolution could continue using GSGP without LS to control overfitting. Other methods that have been defined to control overfitting for GSGP and GP are the dynamic interleaving of training instances [96] and soft target regularization [97]. These methods look promising for GSGP-LS. Last but not least, the use of an explicit feature selection in a preprocessing phase [98], to integrate the implicit feature selection already performed by GP during the learning, like for instance the approach proposed in [99], should be investigated. Furthermore, future studies and experiments focusing on GSGP-LS and classification should be conducted using larger and more complex datasets. 62
BIBLIOGRAPHY [54] L. Beadle and C. Johnson. “Semantic analysis of program initialisation in genetic programming”. In: Genetic Programming and Evolvable Machines 10 (2009-09), pp. 307–337. doi:10.1007/s10710-009-9082-5 (cit. on p. 19). [55] D. Jackson. “Phenotypic Diversity in Initial Genetic Programming Populations”. In: vol. 6021. 2010-04, pp. 98–109. isbn: 978-3-642-12147-0. doi: 10.1007/978-3 -642-12148-7_9 (cit. on p. 19). [56] K. Krawiec and P. Lichocki. “Approximating geometric crossover in semantic space”. In: 2009-01, pp. 987–994. doi:10.1145/1569901.1570036 (cit. on p. 19). [57] K. Krawiec and B. Wieloch. “Analysis of Semantic Modularity for Genetic Programming”. In: Foundations of Computing and Decision Sciences 34 (2009-01), pp. 265–285 (cit. on p. 19). [58] Q. U. Nguyen, N. Hoai, and M. O’Neill. “Semantic Aware Crossover for Genetic Programming: The Case for Real-Valued Function Regression”. In: 2009-04, pp. 292–302. isbn: 978-3-642-01180-1. doi: 10.1007/978-3-642-01181-8_25 (cit. on p. 19). [59] Q. U. Nguyen et al. “Semantically-based crossover in genetic programming: Application to real-valued symbolic regression”. In: Genetic Programming and Evolvable Machines 12 (2011-06), pp. 91–119. doi: 10.1007/s10710-010-9121-2 (cit. on p. 20). [60] M. Castelli, L. Vanneschi, and S. Silva. “Prediction of high performance concrete strength using Genetic Programming with geometric semantic genetic operators”. In: Expert Systems with Applications: An International Journal 40 (2013-12), pp. 6856– 6862. doi:10.1016/j.eswa.2013.06.037 (cit. on pp. 20,35). [61] M. Castelli, L. Vanneschi, and S. Silva. “Prediction of the Unified Parkinson’s Disease Rating Scale assessment using a genetic programming system with geometric semantic genetic operators”. In: Expert Systems with Applications 41 (2014-08), 4608–4616. doi:10.1016/j.eswa.2014.01.018 (cit. on pp. 20,36). [62] M. Castelli, L. Manzoni, and L. Vanneschi. “An Efficient Genetic Programming System with Geometric Semantic Operators and its Application to Human Oral Bioavailability Prediction”. In: (2012-08) (cit. on p. 20). [63] I. Bakurov et al. “General Purpose Optimization Library (GPOL): A Flexible and Efficient Multi-Purpose Optimization Library in Python”. In: Applied Sciences 11 (2021-05). doi:10.3390/app11114774 (cit. on p. 20). [64] H. Iba, T. Sato, and H. de Garis. “System identification approach to genetic programming”. In: Proceedings of the First IEEE Conference on Evolutionary Computation. IEEE World Congress on Computational Intelligence. 1994, 401–406 vol.1. doi:10.1109/ICEC.1994.349917 (cit. on p. 21). 68
BIBLIOGRAPHY [65] H. Iba and N. Nikolaev. “Genetic programming polynomial models of financial data series”. In: Proceedings of the 2000 Congress on Evolutionary Computation. CEC00 (Cat. No.00TH8512). Vol. 2. 2000, 1459–1466 vol.2. doi: 10.1109/CEC.20 00.870826 (cit. on p. 21). [66] N. Nikolaev and H. Iba. “Regularization approach to inductive genetic programming”. In: IEEE Transactions on Evolutionary Computation 5.4 (2001), pp. 359–375. doi:10.1109/4235.942530 (cit. on p. 21). [67] H. G. Hiden. “Data-based modelling using genetic programming.” PhD thesis. University of Newcastle upon Tyne, 1998 (cit. on p. 21). [68] M. - J. Willis et al. “Genetic programming: An introduction and survey of applications”. In: Second international conference on genetic algorithms in engineering systems: innovations and applications. IET. 1997, pp. 314–319 (cit. on p. 21). [69] B. McKay et al. “Non-linear continuum regression using genetic programming”. In: Proceedings of the 1st Annual Conference on Genetic and Evolutionary Computation- Volume 2. 1999, pp. 1106–1111 (cit. on p. 21). [70] M. Keijzer. “Scaled Symbolic Regression”. In: Genetic Programming and Evolvable Machines 5.3 (2004), 259–269. issn: 1389-2576. doi: 10.1023/B:GENP.000003019 5.77571.f9 (cit. on p. 21). [71] F. Archetti, I. Giordani, and L. Vanneschi. “Genetic programming for anticancer therapeutic response prediction using the NCI-60 dataset”. In: Computers & Operations Research 37 (2010-08), pp. 1395–1405. doi: 10.1016/j.cor.2009.02 .015 (cit. on p. 21). [72] C. Pennachin, M. Looks, and J. A. de Vasconcelos. “Robust Symbolic Regression with Affine Arithmetic”. In: Genetic and Evolutionary Computation COnference (GECCO). 2010 (cit. on p. 21). [73] R. M. A. Azad and C. Ryan. “A Simple Approach to Lifetime Learning in Genetic Programming-Based Symbolic Regression”. In: Evolutionary Computation 22.2 (2014-06), pp. 287–317. issn: 1063-6560. doi: 10.1162/EVCO_ a_00111 . eprint: https://direct.mit.edu/evco/articlepdf/22/2/287/1509584 /evco\_a\_00111.pdf (cit. on p. 21). [74] M. Virgolin, T. Alderliesten, and P. A. N. Bosman. “Linear Scaling with and within Semantic Backpropagation-Based Genetic Programming for Symbolic Regression”. In: Proceedings of the Genetic and Evolutionary Computation Conference. GECCO ’19. Prague, Czech Republic: Association for Computing Machinery, 2019, 1084–1092. isbn: 9781450361118. doi: 10.1145/3321707.3321758 (cit. on p. 22). 69
BIBLIOGRAPHY [75] S. Ruberto, V. Terragni, and J. Moore. “A semantic genetic programming framework based on dynamic targets”. In: Genetic Programming and Evolvable Machines 22 (2021-12), pp. 1–31. doi:10.1007/s10710-021-09419-3 (cit. on p. 22). [76] S. Ruberto, V. Terragni, and J. H. Moore. “Towards Effective GP Multi-Class Classification Based on Dynamic Targets”. In: Proceedings of the Genetic and Evolutionary Computation Conference. GECCO ’21. Lille, France: Association for Computing Machinery, 2021, 812–821. isbn: 9781450383509. doi: 10.1145/344 9639.3459324 (cit. on p. 22). [77] D. Medernach et al. “A New Wave: A Dynamic Approach to Genetic Programming”. In: Proceedings of the Genetic and Evolutionary Computation Conference 2016. GECCO ’16. Denver, Colorado, USA: Association for Computing Machinery, 2016, 757–764. isbn: 9781450342063. doi: 10.1145/2908812.2908857 .url: https://doi.org/10.1145/2908812.2908857 (cit. on p. 22). [78] A. S. Sambo et al. “Feature Engineering for Improving Robustness of Crossover in Symbolic Regression”. In: Proceedings of the 2020 Genetic and Evolutionary Computation Conference Companion. GECCO ’20. Cancún, Mexico: Association for Computing Machinery, 2020, 249–250. isbn: 9781450371278. doi: 10.1145 /3377929.3390078 .url: https://doi.org/10.1145/3377929.3390078 (cit. on p. 22). [79] M. Castelli et al. “The influence of population size in geometric semantic GP”. In: Swarm and Evolutionary Computation 32 (2017), pp. 110–120. issn: 2210-6502. doi:https://doi.org/10.1016/j.swevo.2016.05.004 (cit. on p. 32). [80] L. Vanneschi, I. Bakurov, and M. Castelli. “An initialization technique for geometric semantic GP based on demes evolution and despeciation”. In: 2017-06, pp. 113–120. doi:10.1109/CEC.2017.7969303 (cit. on p. 32). [81] M. Castelli et al. “Geometric Semantic Genetic Programming with Local Search”. In: 2015-07. doi:10.1145/2739480.2754795 (cit. on p. 32). [82] L. Vanneschi et al. “Alignment-based genetic programming for real life applications”. In: Swarm and Evolutionary Computation 44 (2018-09). doi: 10.1016 /j.swevo.2018.09.006 (cit. on p. 32). [83] F. Archetti, I. Giordani, and L. Vanneschi. “Genetic programming for QSAR investigation of docking energy”. In: Applied Soft Computing 10.1 (2010), pp. 170– 182. issn: 1568-4946. doi: https://doi.org/10.1016/j.asoc.2009.06.013 . url: https://www.sciencedirect.com/science/article/pii/S15684946090 00787 (cit. on pp. 33,39). [84] D. Harrison and D. L. Rubinfeld. “Hedonic housing prices and the demand for clean air”. In: Journal of Environmental Economics and Management 5.1 (1978), pp. 81–102. issn: 0095-0696. doi: https://doi.org/10.1016/0095-0696(78)9 0006-2 (cit. on p. 34). 70
BIBLIOGRAPHY [85] I. - C. Yeh. “Modeling of strength of high-performance concrete using artificial neural networks”. In: Cement and Concrete Research 28.12 (1998), pp. 1797–1808. issn: 0008-8846. doi: https://doi.org/10.1016/S0008-8846(98)00165-3 (cit. on p. 35). [86] M. A. Little et al. “Exploiting Nonlinear Recurrence and Fractal Scaling Properties for Voice Disorder Detection”. In: BioMedical Engineering OnLine 6.1 (2007), p. 23. issn: 1475-925X. doi:10.1186/1475-925X-6-23 (cit. on p. 36). [87] O. Akbilgic et al. “A novel Hybrid RBF Neural Networks model as a forecaster”. In: Statistics and Computing 24 (2013-05). doi: 10.1007/s11222-013-9375-7 (cit. on p. 37). [88] F. Archetti et al. “Genetic Programming for Human Oral Bioavailability of Drugs”. In: Proceedings of the 8th Annual Conference on Genetic and Evolutionary Computation. GECCO ’06. Seattle, Washington, USA: Association for Computing Machinery, 2006, 255–262. isbn: 1595931864. doi: 10.1145/1143997.1144042 . url:https://doi.org/10.1145/1143997.1144042 (cit. on p. 38). [89] L. Vanneschi, D. Codecasa, and G. Mauri. “A Comparative Study of Four Parallel and Distributed PSO Methods”. In: New Generation Comput. 29 (2011-04), pp. 129– 161. doi:10.1007/s00354-010-0102-z (cit. on p. 39). [90] Volker Lohweg, Helene Doerksen. Banknote Authentication Data Set. The UCI Machine Learning Repository. Accessed: 2023-27-02. 2012. url: https:// archive.ics.uci.edu/ml/datasets/banknote+authentication (cit. on p. 41). [91] Burak Karacayir, Berfin Sakallioglu, F. Zulal Kiraz. Song Prediction for a Funk Band using Machine Learning Algorithms. ML Project. 2020 (cit. on p. 42). [92] N. Street, W. Wolberg, and O Mangasarian. “Nuclear Feature Extraction For Breast Tumor Diagnosis”. In: Proc. Soc. Photo-Opt. Inst. Eng. 1993 (1999-01). doi: 10.1117/12.148698 (cit. on p. 43). [93] G. Dick, A. P. Rimoni, and P. A. Whigham. “A re-examination of the use of genetic programming on the oral bioavailability problem”. In: Proceedings of the 2015 Annual Conference on Genetic and Evolutionary Computation. 2015, pp. 1015–1022 (cit. on p. 57). [94] I. Gonçalves et al. “Unsure when to stop? ask your semantic neighbors”. In: Proceedings of the Genetic and Evolutionary Computation Conference. 2017, pp. 929– 936 (cit. on pp. 58,62). [95] M. Castelli et al. “Geometric Semantic Genetic Programming with Local Search”. In: Proceedings of the 2015 Annual Conference on Genetic and Evolutionary Computation. GECCO ’15. Madrid, Spain: Association for Computing Machinery, 2015, 999–1006. isbn: 9781450334723. doi:10.1145/2739480.2754795 (cit. on p. 62). 71
BIBLIOGRAPHY [96] I. Gonçalves and S. Silva. “Balancing Learning and Overfitting in Genetic Programming with Interleaved Sampling of Training Data”. In: Genetic Programming. Ed. by K. Krawiec et al. Berlin, Heidelberg: Springer Berlin Heidelberg, 2013, pp. 73–84. isbn: 978-3-642-37207-0 (cit. on p. 62). [97] L. Vanneschi and M. Castelli. “Soft target and functional complexity reduction: A hybrid regularization method for genetic programming”. In: Expert Systems with Applications 177 (2021), p. 114929. issn: 0957-4174. doi: https://doi.org/10.1 016/j.eswa.2021.114929 (cit. on p. 62). [98] I. Guyon and A. Elisseeff. “An Introduction to Variable and Feature Selection”. In: J. Mach. Learn. Res. 3.null (2003), 1157–1182. issn: 1532-4435 (cit. on p. 62). [99] N. M. Rodrigues et al. “SLUG: Feature Selection Using Genetic Algorithms and Genetic Programming”. In: Genetic Programming. Ed. by E. Medvet, G. Pappa, and B. Xue. Cham: Springer International Publishing, 2022, pp. 68–84. isbn: 978-3-031-02056-8 (cit. on p. 62). Thisdocumentwascreatedwiththe(pdf/Xe/Lua)L ATE XprocessorandtheNOVAthesistemplate(v6.10.12)[0].12cc90221730b8ba41bb3b1f8b517acd [0] J.M.Lourenço.TheNOVAthesisL A T EXTemplateUser’sManual.NOVAUniversityLisbon.2021.URL:https://github.com/joaomlourenco/novathesis/raw/master/template.pdf(cit.onp.72). 72
Berfin Sakallioglu A Study of Geometric Semantic Genetic Programming with Linear Scaling 2023
STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledge the Rules of Conduct and Code of Honor from the NOVA Information Management School. Lisbon, February 2023