Soft Genetic Programming Binary Classifiers
The study of the classifier’s design and it’s usage is one of the most important machine learning areas. With the development of automatic machine learning methods, various approaches are used to build a robust classifier model. Due to some difficult implementation and customization complexity, genetic programming (GP) methods are not often used to construct classifiers. GP classifiers have several limitations and disadvantages. However, the concept of “soft” genetic programming (SGP) has been developed, which allows the logical operator tree to be more flexible and find dependencies in datasets, which gives promising results in most cases. This article discusses a method for constructing binary classifiers using the SGP technique. The test results are presented. Source code - https://github.com/survexman/sgp_classifier
Soft Genetic Programming Binary Classifiers
Genetic Programming (GP) is a promising machine learning technique based on the principles of Darwinian evolution to automatically evolve computer programs to solve problems. GP is especially suitable for building a classifier of tree representation. GP is a soft computing search technique, which is used to evolve a tree-structured program toward minimizing the fitness value of it. The distinctive features of GP make it very convenient for classification, and the benefit of it is the flexibility, which allows the algorithm to be adapted to the needs of each particular problem.
A special case of GP studies the logical tree’s development as a solution to a classification problem . Logical trees are composed of boolean, comparison, and arithmetic operators, and they output a boolean value ( true or false). A solution presented as a logical tree is a very convenient way to analyze a dataset and interpret a solution. Figure 1 shows an example of logical tree.
This logical tree can be rewritten as the following system of inequalities:
Evolving logical trees using GP has the benefit of being able to handle both numerical and categorical data fairly simply. Significant advantage of evolving logical trees is the fact that the trees are highly interpretable to a researcher . Logical trees are portable and can be easily implemented by various tools and programming languages. Another significant advantage is an ability of feature extraction .
However, one of the most critical problems in logical trees is a crucial logic change when a tree operator changes . Such operator changes occur as a result of crossover and mutation operations .
Figure 2 shows a simple change of addition operator to power operator in logical tree:
And below at Figure 3 we can see the effect of such modification:
We see that switching the operator +(y,15) to pow(y,15) changes the logic of the classifier drastically. The more complex the logical tree is, the more this feature is noticeable. This sensitivity of logical trees to tiny changes makes it very difficult to find the appropriate logical tree in a smooth way.
2 Study Roadmap
SGP classifier design is based on classical GP classifier design. First, we will define the architecture of GP classifier. Next, we will introduce the Soft Genetic Programming approach, its design, and evolution operations. Soft Genetic Programming’s main goal is to smoothen evolution improvement and increase the probability of reaching local maxima. After, we will compare the behavior of classical GP Classifier and SGP Classifier. And finally, we will present empirical evidence of the applicability of SGP approach.
3 Genetic Programming Classifier Design
Genetic programming (GP) is a flexible and powerful evolutionary technique with some special features that are suitable for building a classifier of tree representation. .
We will use the following operators for genetic programming trees :
3.2 Random Tree Generation
Random tree generation is limited by maximum and minimum operator type subchain :
3.3 Fitness Function
For fitness function we use Balanced Accuracy:
The crossover operator creates two new offspring which are formed by taking parts (genetic material) from two parents. The operator selects two parents from the population based on a selection method. A crossover point is then randomly selected in both trees, say point and , from tree and respectively. The crossover then happens as follows: the subtree rooted at is removed from and inserted into the position in . The same logic applies to the point ; the subtree root at the point is removed from and inserted into the place of in . Figure 4 illustrates the crossover operation.
3.5 Operator Mutation
An Operator Mutation works the following way: an operator is randomly selected and replaced with a random tree. A new randomly generated subtree is inserted instead of selected operator . Figure 5 illustrates the operator mutation operation.
3.6 Term Mutation
Term mutation never replaces a term by a random tree. The term mutation is defined as follows:
3.7 Mutation Probabilities
During mutation each operator type is being randomly chosen with following probability table:
Rank selection with elite size 1 used as the selection operation .
3.9 Evolution Algorithm
Evolution is implemented via canonical genetic algorithm method :
4 Soft Genetic Programming Classifier Design
The main idea of SGP is the usage of weighted continuous functions instead of discontinuous boolean and comparison functions. Weight setting will allow calibrating each operator’s effect in a pseudo logical tree, leading to a more adaptive classifier design.
4.1 Soft Operators
We change boolean and comparison operators to weighted continuous analogs  (we will call those function sets pseudo boolean and pseudo comparison operators):
Also we will add additional operators:
Also we will add additional nonlinear operators:
4.2 Soft Tree Representation
SGP tree is a tree where each pseudo boolean and comparison operator has its weight parameter, as is shown on Figure 6:
4.3 Random Tree Generation
4.4 Fitness Function
4.5 Weight Adjustment
In SGP we introduce weight adustment operation:
The main point of weight adjustment operation is to find any positive improvement using weight calibration.
4.6 Fitness Driven Genetic Operations
The main problem of classifier trees is that they have very fragile structures, and the probability of degradation after canonical crossover and mutation operations is to high. In the SGP evolution algorithm, we will use only positive improvement evolution operations.
Positive Crossover doesn’t accept an offsrping which is worse then its parents:
Positive Mutation accepts only those mutations which improves individual’s genome:
4.7 Extension Mutation
There is a handy technique for avoiding stucking an improvement of the population in some specific random subspace. A good way of an individual improvement is adding OR operator as tree root with random subtree, as it is shown on the Figure 7.
The Extension Mutation operation increases the probability of positive genome improvement.
4.8 Multiple Population
The usage of fitness driven crossover and mutation operation provokes the problem of lacking gene variation. This problem is solved using the multiple population technique. On each Nth generation the best individual of each population is “thrown” to the sequent population .
4.9 Evolution Algorithm
SGP evolution algorithm:
Let’s compare the behavior of GP and SGP Classifier on generated 2D datasets .
We can see that both GP and SGP classifiers show confident behavior. As it could be expected, the SGP Classifier tends to use nonlinear dependencies. SGP classifier highly likely have strict borders(i.e. ), as it is common behavior for Decision Trees.
6 Experimental Results
We have tested SGP and GP classifiers using Large Benchmark Suite  for binary classification problem. As a classification quality score we used balanced accuracy.
Test results were gathered by following testing algorithm:
Below we provide a heatmap table view with mean balanced accuracy results:
|prnn crabs||heart h||crx||haberman||breast||flare|
|pima||german||heart c||credit g||buddyCrx||prnn synth|
SGP provides very positive average results, and especially nice at haberman and flare datasets. All results can be regathered running script https://github.com/survexman/sgp_classifier/blob/main/soft/gp_classification.py
This survey introduces the concept of Soft Genetic Programming. The robustness of the SGP Classifier is presented. This research aimed to deliver a new genetic programming design with pseudo boolean and pseudo comparison operators and show its quality.
Never the less SGP has several drawbacks:
Performance issue. SGP training stage takes much more time than classical classifers do.
An incapability to use SGP as a feature selection tool. Due to the weighted operator design, each branch and operator can have a very low weight. Thus the term that belongs to the weighted operator has low significance and cannot be used as a significant feature. In classical GP Classifier, each symbolic variable highly likely has a high significance degree and can thus be selected as meaningful feature.
Anyway, the improvement of the SGP technique for a particular task can provide excellent practical results.
- Chan-Sheng Kuo and T. Hong and Chuen-Lung Chen Applying genetic programming technique in classification trees, 2007 Soft Computing, vol. 11, pages 1165-1172
- Koza, John R. Genetic Programming: On the Programming of Computers by Means of Natural Selection 1992 0-262-11170-5 MIT Press Cambridge, MA, USA
- Bhowan Urvesh, Zhang Mengjie and Johnston Mark Genetic Programming for Classification with Unbalanced Data 2010 Springer Berlin Heidelberg pages 1-13 ISBN: 978-3-642-12148-7
- Emmanuel. Dufourq Data classification using genetic programming, 2015
- D. E. Goldberg Genetic Algorithms in Search, Optimization and Machine Learning Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc., 1st ed., 1989.
- Suarez Ranyart, Valencia-Ramírez, José and Graff Mario. Genetic programming as a feature selection algorithm. 2014 IEEE International Autumn Meeting on Power, Electronics and Computing, ROPEC 2014. 1-5. 10.1109/ROPEC.2014.7036345. (2014)
- scikit-learn.org Classifier comparison https://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html
- Silva, Sara and Almeida, Jonas, Dynamic Maximum Tree Depth, Genetic and Evolutionary Computation — GECCO 2003, 1776–1787 Springer Berlin Heidelberg ISSN 978-3-540-45110-5
- Hamed Hatami. Decision trees and influences of variables over product probability spaces, 2006; arXiv:math/0612405.
- O’Donnell Ryan Analysis of Boolean Functions, 2014 Cambridge University Press DOI: 10.1017/CBO9781139814782
- Moulinath Banerjee and Ian W. McKeague. Confidence sets for split points in decision trees, 2007, Annals of Statistics 2007, Vol. 35, No. 2, 543-574; arXiv:0708.1820. DOI: 10.1214/009053606000001415.
- Randal S. Olson, William La Cava, Patryk Orzechowski, Ryan J. Urbanowicz and Jason H. Moore. PMLB: A Large Benchmark Suite for Machine Learning Evaluation and Comparison, 2017; arXiv:1703.00512.
- Søren B. Vilsen, Torben Tvedebrink and Poul Svante Eriksen. DNA mixture deconvolution using an evolutionary algorithm with multiple populations, hill-climbing, and guided mutation, 2020; arXiv:2012.00513.