Bug with matlab API?

51 views
Skip to first unread message

Damien Fay

unread,
Apr 26, 2012, 7:43:33 AM4/26/12
to Eureqa Group
I was having a look at the matlab API and there is a possible bug; in
the gateway file eureqa_select.cpp the following code:

for (i=0;i<nbest;i++)
{
eval[i] = best_solutions[i].fitness_;
mexPrintf("%f \n",eval[i]);
}
std::string eureqa_output =
best_solutions[maxloc(eval,nbest)].text_;
if (verbose)
{
mexPrintf("the selected solution is: ");
mexPrintf("%s\n",eureqa_output.c_str());


myfile.open ("output.txt");
myfile << best_solutions.to_string();
myfile.close();

selects the function with the highest fitness when in fact it should
choose the one with the lowest (really the user should make the choice
based on a complexity fitness trade-off but lets ignore that).

Please let me know if I've made a mistake, thanks, Damien.

Michael Schmidt

unread,
Apr 30, 2012, 5:13:58 PM4/30/12
to eureqa...@googlegroups.com
The API uses the convention that higher fitness means lower error. So I think the code is correct. I would contact Johannes who created the matlab interface for more detail:
http://www.mathworks.com/matlabcentral/fileexchange/authors/164793

Michael



--
Eureqa Formulize ( http://www.nutonian.com )
-------------------------------------------------
Unsubscribe: eureqa-group...@googlegroups.com
View Group: http://groups.google.com/group/eureqa-group

Reply all
Reply to author
Forward
0 new messages