GithubHelp home page GithubHelp logo

chen0040 / cpp-linear-genetic-programming Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 49.82 MB

Package provides C++ implementation of linear genetic programming algorithm

License: MIT License

C++ 99.91% C 0.09%
cpp linear-genetic-programming symbolic-regression spiral-classification machine-learning genetic-programming

cpp-linear-genetic-programming's Introduction

cpp-linear-genetic-programming

Package provides C++ implementation of linear genetic programming algorithms described in the book "Linear Genetic Programming".

Introduction

Linear Genetic Programming examines the evolution of imperative computer programs written as linear sequences of instructions. In contrast to functional expressions or syntax trees used in traditional Genetic Programming (GP), Linear Genetic Programming (LGP) employs a linear program structure as genetic material whose primary characteristics are exploited to achieve acceleration of both execution time and evolutionary progress (From the book "Linear Genetic Programming").

Usage

git clone this project to your local computer. The solution file can be open and run using Visual Studio IDE 2017.

Please refers one of the following folders (each of which solve a different optimization problem) on how to create the set of source files that will solve your problem:

  • mexican_hat
  • spiral_classification
  • symreg

The main code to run in the main looks like the following (Note that the C++ code uses xml files for configuration), you can test run the codes in the main.cpp file.

void mexican_hat_demo()
{
	LGPConfig config("mexican_hat\\LGPConfig.xml");
	std::cout << config.ToString() << std::endl;

	mexican_hat::XPop  pop(&config);
	//LGPStats stats(&pop);

	pop.BreedInitialPopulation();

	while(!pop.Terminated())
	{
		pop.Evolve();
		std::cout << "mexican hat generation: " << pop.GetCurrentGeneration() << std::endl;
		std::cout << "global fitness: " << pop.GetGlobalFittestProgram()->GetFitness() << "\tcurrent fitness: " << pop.GetFittestProgram()->GetFitness() << std::endl;
		//stats.LogStatistics();
	}

	std::cout << pop.GetGlobalFittestProgram()->ToString(true) << std::endl;
}

cpp-linear-genetic-programming's People

Contributors

chen0040 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

zeta1999

cpp-linear-genetic-programming's Issues

LGPOperator_Multiplication error?

Shouldn't the be x1*x2 vs. x1+x2?

Also, how do you use this program for my dataset - a regression problem with 8 features and the desired result?

Thanks,
Don

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.