Has anyone ever successfully written a model to c++ using GDom::WriteJsonCpp then done something with the resulting string? Writing the string and compiling it in my code is no problem, but I can't figure out how to create a model from it. I want to do something like this:
string cppString = the string generated from GDom::WriteJsonCpp
GDom doc = new GDom;
GDomNode node = doc->newString(cppString.c_str());
GRand rand(0);
GLearnerLoader ll(rand);
GDecisionTree *model = new GDecisionTree(node, ll);
This doesn't work. Any help is appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Fairly new to Waffles...
Has anyone ever successfully written a model to c++ using GDom::WriteJsonCpp then done something with the resulting string? Writing the string and compiling it in my code is no problem, but I can't figure out how to create a model from it. I want to do something like this:
string cppString = the string generated from GDom::WriteJsonCpp
GDom doc = new GDom;
GDomNode node = doc->newString(cppString.c_str());
GRand rand(0);
GLearnerLoader ll(rand);
GDecisionTree *model = new GDecisionTree(node, ll);
This doesn't work. Any help is appreciated.
I think you need to call parseJson, like this:
Perfect! Thanks Mike.