#include <PMMLlib.hxx>
Public Member Functions | |
PMMLLIB_EXPORT | PMMLlib (std::string file, bool log=false) |
PMMLLIB_EXPORT | PMMLlib (bool log=false) |
This constructor is mandatory for Swig because it can be used with no parameters. More... | |
PMMLLIB_EXPORT | ~PMMLlib () |
PMMLLIB_EXPORT void | SetCurrentModel (std::string modelName, PMMLType type) |
PMMLLIB_EXPORT void | SetCurrentModel (std::string modelName) |
Throw an exception if there is no model or more than one model with name "modelName" in the PMML file. More... | |
PMMLLIB_EXPORT void | SetCurrentModel () |
Throw an exception if no model is found or if there are more than one model in the PMLL file. More... | |
PMMLLIB_EXPORT std::string | makeLog () const |
PMMLLIB_EXPORT void | printLog () const |
PMMLLIB_EXPORT void | AddDataField (std::string name, std::string displayName, std::string optype, std::string dataType, std::string closure, double leftMargin, double rightMargin, bool interval=false) |
PMMLLIB_EXPORT void | AddMiningSchema (std::string name, std::string usageType) |
Common to all models. More... | |
PMMLLIB_EXPORT void | SetHeader (std::string copyright, std::string description, std::string appName, std::string appVersion, std::string annotation) |
PMMLLIB_EXPORT void | UnlinkNode () |
PMMLLIB_EXPORT void | BackupNode () |
PMMLLIB_EXPORT int | GetModelsNb () |
PMMLLIB_EXPORT void | Write () |
PMMLLIB_EXPORT void | Write (std::string file) |
PMMLLIB_EXPORT PMMLType | GetCurrentModelType () |
type is kUNDEFINED if no model is set or if model type is not handled More... | |
PMMLLIB_EXPORT std::string | GetCurrentModelName () |
name is "" if no model is set More... | |
PMMLLIB_EXPORT void | AddNeuralNetwork (std::string modelName, PMMLMiningFunction functionName) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT void | AddNeuralInput (int id, std::string inputName, std::string optype, std::string dataType, double orig1, double norm1, double orig2, double norm2) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT void | AddNeuralLayer (PMMLActivationFunction activationFunction) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT void | AddNeuron (int id, double bias, int conNb, int firstFrom, std::vector< double > weights) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT void | AddNeuralOutput (int outputNeuron, std::string outputName, std::string optype, std::string dataType, double orig1, double norm1, double orig2, double norm2) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT int | GetNbInputs () |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT int | GetNbOutputs () |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT std::string | GetNameInput (int input_index) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT std::string | GetNameOutput (int output_index) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT int | GetNormalizationType () |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT void | GetNormalisationInput (int input_index, double *dnorm) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT void | GetNormalisationOutput (int output_index, double *dnorm) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT int | GetNbHiddenLayers () |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT int | GetNbLayers () |
PMMLLIB_EXPORT int | GetNbNeuronsAtLayer (int layer_index) |
PMMLLIB_EXPORT double | GetNeuronBias (int layer_index, int neu_index) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT double | GetPrecNeuronSynapse (int layer_index, int neu_index, int prec_index) |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT void | SetNeuralNetName (int ann_index, std::string ann_name) |
Not tested. More... | |
PMMLLIB_EXPORT std::string | ReadNetworkStructure () |
Specific to NeuralNetwork. More... | |
PMMLLIB_EXPORT void | AddRegressionModel (std::string modelName, PMMLMiningFunction functionName, std::string targetFieldName) |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT void | AddRegressionTable () |
No property "intercept" will be set. More... | |
PMMLLIB_EXPORT void | AddRegressionTable (double intercept) |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT void | AddNumericPredictor (std::string neuronName, int exponent, double coefficient) |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT void | AddPredictorTerm (double coefficient, std::vector< std::string > fieldRef) |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT bool | HasIntercept () |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT double | GetRegressionTableIntercept () |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT int | GetNumericPredictorNb () |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT int | GetPredictorTermNb () |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT std::string | GetNumericPredictorName (int num_pred_index) |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT std::string | GetPredictorTermName (int num_pred_index) |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT double | GetNumericPredictorCoefficient (int num_pred_index) |
(The coefficient is the value of property "coefficient") More... | |
PMMLLIB_EXPORT double | GetPredictorTermCoefficient (int pred_term_index) |
(The coefficient is the value of property "coefficient") More... | |
PMMLLIB_EXPORT int | GetPredictorTermFieldRefNb (int pred_term_index) |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT std::string | GetPredictorTermFieldRefName (int pred_term_index, int field_index) |
(The name is the value of property "field") More... | |
PMMLLIB_EXPORT std::string | ReadRegressionStructure () |
Specific to RegressionModel. More... | |
PMMLLIB_EXPORT void | ExportCpp (std::string file, std::string functionName, std::string header) |
PMMLLIB_EXPORT void | ExportFortran (std::string file, std::string functionName, std::string header) |
PMMLLIB_EXPORT void | ExportPython (std::string file, std::string functionName, std::string header) |
PMMLLIB_EXPORT std::string | ExportPyStr (std::string functionName, std::string header) |
Private Member Functions | |
xmlNodePtr | GetChildByName (xmlNodePtr node, std::string nodename) |
xmlNodePtr | GetPtr (int ann_index, std::string name) |
xmlNodePtr | GetPtr (std::string ann_name, std::string name) |
void | CountModels () |
int | CountNeuralNetModels () |
int | CountRegressionModels () |
void | SetRootNode () |
std::string | GetModelName (xmlNodePtr node) |
std::string | GetTypeString () |
xmlNodePtr | GetNeuralNetPtr (std::string ann_name) |
xmlNodePtr | GetNeuralNetPtr (int ann_index) |
void | CheckNeuralNetwork () |
Called in all methods specific to the NeuralNetwork model. More... | |
xmlNodePtr | GetRegressionPtr (int reg_index) |
xmlNodePtr | GetRegressionPtr (std::string reg_name) |
void | CheckRegression () |
Called in all methods specific to the RegressionModel model. More... | |
void | fillVectorsForExport (int nInput, int nOutput, int nHidden, int normType, std::vector< double > &minInput, std::vector< double > &maxInput, std::vector< double > &minOutput, std::vector< double > &maxOutput, std::vector< double > &valW) |
Specific to NeuralNetwork. More... | |
void | ExportNeuralNetworkCpp (std::string file, std::string functionName, std::string header) |
Specific to NeuralNetwork. More... | |
void | ExportNeuralNetworkFortran (std::string file, std::string functionName, std::string header) |
Specific to NeuralNetwork. More... | |
void | ExportNeuralNetworkPython (std::string file, std::string functionName, std::string header) |
Specific to NeuralNetwork. More... | |
std::string | ExportNeuralNetworkPyStr (std::string functionName, std::string header) |
Specific to NeuralNetwork. More... | |
void | ExportLinearRegressionCpp (std::string, std::string, std::string) |
Specific to RegressionModel. More... | |
void | ExportLinearRegressionFortran (std::string, std::string, std::string) |
Specific to Regression. More... | |
void | ExportLinearRegressionPython (std::string, std::string, std::string) |
Specific to Regression. More... | |
std::string | ExportLinearRegressionPyStr (std::string functionName, std::string header) |
Specific to Regression. More... | |
std::string | _xmlCharToString (const xmlChar *xs) const |
xmlChar * | _stringToXmlChar (const std::string &s) const |
std::string | _getProp (const xmlNodePtr node, std::string const &prop) const |
Private Attributes | |
bool | _log |
Log Printing. More... | |
std::string | _pmmlFile |
Name of the associated PMML file. More... | |
xmlDocPtr | _doc |
Associated DOM documents. More... | |
xmlNodePtr | _rootNode |
Root node of the document. More... | |
xmlNodePtr | _currentNode |
Pointer to the current node. More... | |
int | _nbModels |
Number of models (all kinds) More... | |
std::string | _currentModelName |
Name of the current model. More... | |
PMMLType | _currentModelType |
Type of the current model. More... | |
xmlNodePtr | _currentModelNode |
Pointer to the current model node. More... | |
Class PMMLlib
Definition at line 73 of file PMMLlib.hxx.
|
private |
Get the value of a node property.
node | Tag |
prop | Property |
Definition at line 695 of file PMMLlib.cxx.
References _doc, _stringToXmlChar(), and _xmlCharToString().
Referenced by AddNeuralInput(), AddNeuralLayer(), AddNeuralOutput(), AddNeuron(), fillVectorsForExport(), GetCurrentModelName(), GetModelName(), GetNameInput(), GetNameOutput(), GetNeuronBias(), GetNormalisationInput(), GetNormalisationOutput(), GetNormalizationType(), GetNumericPredictorCoefficient(), GetNumericPredictorName(), GetPrecNeuronSynapse(), GetPredictorTermCoefficient(), GetPredictorTermFieldRefName(), GetPredictorTermName(), GetPtr(), GetRegressionTableIntercept(), ReadNetworkStructure(), ReadRegressionStructure(), and SetCurrentModel().
|
private |
Conversion from a standard C++ string to a libxml2 string (xmlChar *)
s | a constant C++ std::string. |
The caller of this function must free the result when it's not needed anymore (using xmlFree)
Conversion from a a standard C++ string to a libxml2 string (xmlChar *).
s | Constant C++ std::string (contains the same text as xs) |
Definition at line 684 of file PMMLlib.cxx.
Referenced by _getProp(), HasIntercept(), and SetRootNode().
|
private |
xs | a constant libxml string. |
Conversion from a libxml2 string (xmlChar *) to a standard C++ string.
xs | a constant libxml string. |
Definition at line 670 of file PMMLlib.cxx.
References CORBAEngineTest::i.
Referenced by _getProp(), CountNeuralNetModels(), CountRegressionModels(), GetChildByName(), and GetCurrentModelType().
|
private |
Name of the current model.
Definition at line 83 of file PMMLlib.hxx.
Referenced by AddNeuralNetwork(), AddRegressionModel(), BackupNode(), and SetCurrentModel().
|
private |
Pointer to the current model node.
Definition at line 85 of file PMMLlib.hxx.
Referenced by AddMiningSchema(), AddNeuralInput(), AddNeuralLayer(), AddNeuralNetwork(), AddNeuralOutput(), AddRegressionModel(), AddRegressionTable(), BackupNode(), fillVectorsForExport(), GetCurrentModelName(), GetCurrentModelType(), GetNameInput(), GetNameOutput(), GetNbHiddenLayers(), GetNbInputs(), GetNbNeuronsAtLayer(), GetNbOutputs(), GetNeuronBias(), GetNormalisationInput(), GetNormalisationOutput(), GetNormalizationType(), GetNumericPredictorCoefficient(), GetNumericPredictorName(), GetNumericPredictorNb(), GetPrecNeuronSynapse(), GetPredictorTermCoefficient(), GetPredictorTermFieldRefName(), GetPredictorTermFieldRefNb(), GetPredictorTermName(), GetPredictorTermNb(), GetRegressionTableIntercept(), HasIntercept(), ReadNetworkStructure(), ReadRegressionStructure(), SetCurrentModel(), and UnlinkNode().
|
private |
Type of the current model.
Definition at line 84 of file PMMLlib.hxx.
Referenced by AddNeuralNetwork(), AddRegressionModel(), CheckNeuralNetwork(), CheckRegression(), ExportCpp(), ExportFortran(), ExportPyStr(), ExportPython(), GetTypeString(), and SetCurrentModel().
|
private |
Pointer to the current node.
Definition at line 81 of file PMMLlib.hxx.
Referenced by AddNeuralLayer(), AddNeuron(), AddNumericPredictor(), AddPredictorTerm(), and AddRegressionTable().
|
private |
Associated DOM documents.
Definition at line 79 of file PMMLlib.hxx.
Referenced by _getProp(), GetPtr(), PMMLlib(), SetNeuralNetName(), SetRootNode(), Write(), and ~PMMLlib().
|
private |
Log Printing.
Definition at line 77 of file PMMLlib.hxx.
Referenced by BackupNode(), CountModels(), CountNeuralNetModels(), CountRegressionModels(), makeLog(), Write(), and ~PMMLlib().
|
private |
Number of models (all kinds)
Definition at line 82 of file PMMLlib.hxx.
Referenced by CountModels(), GetModelsNb(), and SetCurrentModel().
|
private |
Name of the associated PMML file.
Definition at line 78 of file PMMLlib.hxx.
Referenced by makeLog(), PMMLlib(), SetNeuralNetName(), and Write().
|
private |
Root node of the document.
Definition at line 80 of file PMMLlib.hxx.
Referenced by AddDataField(), AddNeuralNetwork(), AddRegressionModel(), CountNeuralNetModels(), CountRegressionModels(), GetPtr(), PMMLlib(), SetCurrentModel(), SetHeader(), SetNeuralNetName(), and SetRootNode().