Contents
Class TreeFeature
java.lang.Object
org.tribuo.regression.rtree.impl.TreeFeature
- All Implemented Interfaces:
Iterable<InvertedFeature>
An inverted feature, which stores a reference to all the values of this feature.
Can be split into two values based on an example index list.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeepCopy()
Returns a deep copy of this tree feature.void
fixSize()
Fixes the size of eachInvertedFeature
's inner arrays.iterator()
void
observeValue
(double value, int exampleID) Observes a value for this feature.void
sort()
Sort the list using InvertedFeature's natural ordering.com.oracle.labs.mlrg.olcut.util.Pair
<TreeFeature, TreeFeature> split
(int[] leftIndices, int[] rightIndices, IntArrayContainer firstBuffer, IntArrayContainer secondBuffer) Splits this tree feature into two.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceIterable<InvertedFeature>
-
getFeature
-
observeValue
public void observeValue(double value, int exampleID) Observes a value for this feature.- Parameters:
value
- The value observed.exampleID
- The example id number.
-
sort
public void sort()Sort the list using InvertedFeature's natural ordering. Must be done after all elements are inserted. -
fixSize
public void fixSize()Fixes the size of eachInvertedFeature
's inner arrays. -
split
public com.oracle.labs.mlrg.olcut.util.Pair<TreeFeature, TreeFeature> split(int[] leftIndices, int[] rightIndices, IntArrayContainer firstBuffer, IntArrayContainer secondBuffer) Splits this tree feature into two.- Parameters:
leftIndices
- The indices to go in the left branch.rightIndices
- The indices to go in the right branch.firstBuffer
- A buffer for temporary work.secondBuffer
- A buffer for temporary work.- Returns:
- A pair of TreeFeatures, the first element is the left branch, the second the right.
-
toString
-
deepCopy
-