Data into PushGP Regression Model

October 7, 2009
by Jeremy Koelmel (jpk07)

//HTML code to plug an array of data into an evolved push function. Evolved function made in the PshGP example regression1.pushgp by Jon Klein modeling data from y = 12x^2 + 5. Help with HTML java script push implementation from Paul Sawaya

<script src=”push.js”></script>
function main()
var x = new Array(“1.1″,”2.1″,”3.1″,”4.1”);
for (i=0;i<=3;i++)


// push function manually pasted from regression1.pushgp
var form = new String(“5.0 7.0 FLOAT.+ FLOAT.* FLOAT.% FLOAT.% FLOAT.* FLOAT.SWAP        FLOAT.+ ” + parseFloat(x[i]) + ” FLOAT.* 6.0 FLOAT.+ 1.0 FLOAT.- FLOAT.SWAP FLOAT.-“);
var program = pushParseString(form);
var interpreter = new pushInterpreter();
var info = pushRunProgram( interpreter, program )


Jeremy & Dan

Leave a Reply

You must be logged in to post a comment.