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
-
| configuration | the configuration the random tree/forest was trained with |
| outputFolder | the folder the JSON file(s) should be written to |
| trainingFolder | the folder the training images were loaded from |
| verbose | if 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
-
| tree | the random tree which is usually part of a random forest |
| treeNr | the 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
-
| ensemble | the 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: