curfil  ..
 All Classes Functions Variables Typedefs Friends Groups Pages
Public Member Functions | List of all members
curfil::RandomTreeExport Class Reference

Helper class to export a random tree or random forest to disk in compressed (gzip) JSON format. More...

#include <export.h>

Public Member Functions

 RandomTreeExport (const TrainingConfiguration &configuration, const std::string &outputFolder, const std::string &trainingFolder, bool verbose)
 Prepare an export with the given configuration.
void writeJSON (const RandomTreeImage &tree, size_t treeNr) const
 Export the given random tree to disk as compressed (gzip) JSON file.
template<class TreeEnsemble >
void writeJSON (const TreeEnsemble &ensemble) const
 Export the given random forest to disk as compressed (gzip) JSON files.

Detailed Description

Helper class to export a random tree or random forest to disk in compressed (gzip) JSON format.

See Also
RandomTreeImport

Definition at line 17 of file export.h.

Constructor & Destructor Documentation

curfil::RandomTreeExport::RandomTreeExport ( const TrainingConfiguration configuration,
const std::string &  outputFolder,
const std::string &  trainingFolder,
bool  verbose 
)

Prepare an export with the given configuration.

Parameters
configurationthe configuration the random tree/forest was trained with
outputFolderthe folder the JSON file(s) should be written to
trainingFolderthe folder the training images were loaded from
verboseif true, the JSON file contains per-node profiling information. Attention: verbose JSON files are significantly larger even if compressed.

Member Function Documentation

void curfil::RandomTreeExport::writeJSON ( const RandomTreeImage tree,
size_t  treeNr 
) const

Export the given random tree to disk as compressed (gzip) JSON file.

Parameters
treethe random tree which is usually part of a random forest
treeNrthe number (id) of the tree in the random forest. Use 0 if the tree is not part of a forest.
template<class TreeEnsemble >
void curfil::RandomTreeExport::writeJSON ( const TreeEnsemble &  ensemble) const
inline

Export the given random forest to disk as compressed (gzip) JSON files.

Each tree of the forest is stored in a separate file.

Parameters
ensemblethe random forest that contains several random trees

Definition at line 48 of file export.h.


The documentation for this class was generated from the following file: