logicGP

What is logicGP?

Introduction

A Framework for Literal Based Classification

At a glance

  • New hypothesis space for supervised learning based on literals
  • Hypotheses in the space may be represented as trees
  • Genetic Programming may be used to obtain the hypotheses

Classification


sepall sepalw petall petalw Class
5.1 3.5 1.4 0.2 Setosa
7.0 3.2 4.7 1.4 Versicolor
6.3 3.3 6.0 2.5 Virginica

Literals

  • Term is commonly used in Boolean algebra
  • Atomic formulas or their negations
  • Evaluating to true or false
  • Examples for classification:
    • sepal length > 6.0
    • sepal length ≤ 6.0
    • petal width ∈ [1.9; 2.5]

logicGP Classification Model

wseto wvers wvirg Condition
1.00 0.00 0.00 None below fulfilled
0.00 2.31 1.39 petal width ∈ [1.4;1.6]
0.00 5.56 0.00 sepal width ∈ [2.0;3.0] petal width ∈ [0.4;1.3]
0.00 0.00 7.00 petal length ∈ [5.2;6.9]
0.00 0.00 7.00 petal width ∈ [1.9;2.5]

Genetic Programming


Some Results

Implementation

Why C#?

  • Common choice for enterprise software
  • Superior performance in comparison to Python
  • More modern than Java

Existing Projects

  • ML.NET is Microsoft’s open-source machine learning (ML) framework for .NET
    • Necessary and helpful but difficult to expand
  • aima-csharp provides C# implementations for algorithms discussed in Artificial Intelligence - A Modern Approach
    • Incomplete and outdated
  • GeneticSharp is a Genetic Algorithm library
    • Focussed on Genetic Algorithms and not Genetic Programming
  • Genetica is a Genetic Programming library
    • Outdated

New Open Source Projects

  • Italbytz.ML provides extensions for ML.NET necessary for the implementation of custom algorithms
  • Italbytz.Ports.Algorithms.AI and Italbytz.Adapters.Algorithms.AI
    • Provide C# interfaces and implementations for algorithms discussed in Artificial Intelligence - A Modern Approach
    • Offers Genetic Programming library for the implementation of logicGP
    • Genetic and Evolutionary Computation library inspired by FrEAK planned

Genetic and Evolutionary Computation Library

FrEAK



Current Situation

  • Very pragmatic approach with focus on logicGP
  • No focus on UI
  • Generalizability and expandability was maintained
  • Greater use of the library in teaching planned
  • Further development in cooperation with external Open Source developers would be great

(1+1) EA

var onePlusOneEA = new EvolutionaryAlgorithm
{
    FitnessFunction = new OneMax(),
    SearchSpace = new BitString(),
    AlgorithmGraph = new OnePlusOneEAGraph()
};
onePlusOneEA.Initialization = new RandomInitialization(onePlusOneEA);
onePlusOneEA.StoppingCriteria =
[
    new GenerationStoppingCriterion(onePlusOneEA)
];
await onePlusOneEA.Run();
public class OnePlusOneEAGraph : OperatorGraph
{
    public OnePlusOneEAGraph()
    {
        Start = new Start();
        Finish = new Finish();
        var mutation = new StandardMutation();
        var selection = new CutSelection();
        Start.AddChildren(mutation, selection);
        mutation.AddChildren(selection);
        selection.AddChildren(Finish);
    }
}
% dotnet test --filter "Name=TestOnePlusOneEA"
Gen | Fit | Genotype
--- | --- | ----------------------------------------------------------------
  1 |  26 | 0011001000011010000100100110100110000000010001001011101110010111 
  2 |  26 | 0011001000011010000100100110100110000000010001001011101110010111 
  3 |  26 | 0011001000011010000100100110100110000000010001101011101010010111 
  4 |  26 | 0011001000011010000100100110100110000000010001101011101010010111 
  5 |  28 | 0011001000011010000100100110100110000100010001101011101110010111 
...