public class WagonCARTReader extends Object
Constructor and Description |
---|
WagonCARTReader(LeafNode.LeafType leafType)
When creating a WagonCARTReader provide a tree type
|
Modifier and Type | Method and Description |
---|---|
protected LeafNode |
createFeatureVectorLeafNode(String line) |
protected LeafNode |
createFloatLeafNode(String line) |
protected LeafNode |
createIntAndFloatArrayLeafNode(String line) |
protected LeafNode |
createIntArrayLeafNode(String line) |
protected LeafNode |
createLeafNode(String line)
For a line representing a leaf in Wagon format, create a leaf.
|
protected LeafNode |
createStringAndFloatLeafNode(String line) |
void |
fillLeafs(Node root,
FeatureVector[] featureVectors)
Fill the FeatureVector leafs of a tree with the given feature vectors.
|
Node |
load(BufferedReader reader,
FeatureDefinition featDefinition)
This loads a cart from a wagon tree in textual format, from a reader.
|
Node |
load(String fileName,
FeatureDefinition featDefinition,
String[] dummy)
Load the cart from the given file
|
public WagonCARTReader(LeafNode.LeafType leafType)
leafType
- ClasificationTree, ExtendedClassificationTree, RegressionTree, or TopLevelTree.
ClasificationTree → IntArrayLeafNode
ExtendedClassificationTree → IntAndFloatArrayLeafNode
RegressionTree → FloatLeafNode
TopLevelTree → FeatureVectorLeafNode
StringCART → StringAndFloatLeafNode
protected LeafNode createLeafNode(String line)
line
- a line from a wagon cart file, representing a leafpublic Node load(BufferedReader reader, FeatureDefinition featDefinition) throws IOException
reader
- the Reader providing the wagon treefeatDefinition
- featDefinitionIOException
- IOExceptionpublic Node load(String fileName, FeatureDefinition featDefinition, String[] dummy) throws IOException, MaryConfigurationException
fileName
- the file to load the cart fromfeatDefinition
- the feature definitiondummy
- unused, just here for compatibility with the FeatureFileIndexer.IOException
- if a problem occurs while loadingMaryConfigurationException
- MaryConfigurationExceptionpublic void fillLeafs(Node root, FeatureVector[] featureVectors)
root
- node of the tree.featureVectors
- the feature vectors.Copyright © 2000–2016 DFKI GmbH. All rights reserved.