Export GPdotNET Model in to Mathematica


The next version of GPdotNET will be able to export training and testing data, as well as GP Model in to Mathematica. I found this feature very useful while I was modelling and trying to plot GP models in to Mathematica.

This blog post will demonstrate how to export GP Model in to Mathematica, and perform further operations in order to get more information from your model.

Before exporting to Mathematica, you need to calculate GP model. Suppose we have calculated the model and want to export it to Mathematica, see picture below.

The bottom text box from the picture above shows GP model in analytic form. This is pretty much terms and operations. Actually the analytic term of GP Model will be converted in to Mathematica syntax, and exported to txt file. On this way you can copy exported text and paste to Mathematica.

From the Export GP Result group controls choose GP Model button, select Mathematica, click OK, name the txt file and press OK button. All operations are showed on picture below.

Now we have Training data set and GP model in Mathematica language, so we can copy them and paste in to Mathematica notebook.

Open saved txt file and  you will see something similar showed on the picture below.

The file contain two things:

  • Training data model represented as Mathematica list collection, and
  • GP Model translated in to Mathematica notation.

Copy the first group of text and paste it to Mathematica notebook, then copy the second text group and paste to Mathematica below the first one. The flowing picture shows training data set and GP model in Mathematica.

Now that we have GP model in Mathematica, we can do lot of things.

Simplifying GP analytic model:  By typing Simplify[gpmodel], Mathematica will try to simplify your model as simple as possible.

Look what happens when we execute Simplify[gpmodel] against the model we are currently dealing:

This is awesome, and nobody can simplify such a complex term better than Mathematica.

If your model contains 3 or less independent variables you can plot it. For example execute this command:

funpl = Plot[{gpmodel}, {X1, -40, 20}, PlotRange -> {{-45, 25}, {35, 220}}, Frame -> True , PlotLegends -> Placed[{“GP Model”}, Above]]

The picture below shows the result from the command above:

That was just a few options you can execute against GP model when you export it to Mathematica.

GPdotNET vNext: Assignment and Transportation problems


GPdotNET vNext

Recently I wrote blog post  about implementation of TSP problem in GPdotNET. I got positive feedback about implementation, but there were people saying if can I implement more problems based on linear programming and optimization. So I have decided to implement Assignment and Transportation problems in GPdotNET. With existing 4,  the next version of GPdotNET 2.5 will contains in total the following problem domains:

1. Modelling discrete data set with GP,

2. Modelling and optimization discrete data set with combination of GP and GA,

3. Modelling Time series data set with GP,

4. Optimization of Analytic function with GA,

5. Traveling Salesman Problem with GA,

6. Assignment Problem with GA,

7. Transportation problem with GA.

In order to implement those problems it has to be implemented two new chromosome types:

1. Vector based GA chromosome for solving TSP and Assigment problem

2. Matrix based GA chromosome for solving Transport problem.

The first one (vector based chromosome type) is already implemented and needs to be modified for accepting different format data, in order to fully support TSP and Assignment problems at the same time. For second type there are several solutions for implementation for Matrix based chromosome, one of my favorite is published in the book .

I can say this would be an exciting summer. :)