com.stripe.brushfire

AnnotatedTree

case class AnnotatedTree[K, V, T, A](root: Node[K, V, T, A]) extends Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AnnotatedTree
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AnnotatedTree(root: Node[K, V, T, A])

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def annotate[A1](f: (T) ⇒ A1)(implicit arg0: Semigroup[A1]): AnnotatedTree[K, V, T, A1]

    Annotate the tree by mapping the leaf target distributions to some annotation for the leaves, then bubbling the annotations up the tree using the Semigroup for the annotation type.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def compress: FullBinaryTree[(K, Predicate[V], A), (Int, T, A)]

  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def growByLeafIndex(fn: (Int) ⇒ Option[SplitNode[K, V, T, A]])(implicit s: Semigroup[A]): AnnotatedTree[K, V, T, A]

    For each leaf, this may convert the leaf to a SplitNode whose children have the target distribution returned by calling fn with the leaf's index.

    For each leaf, this may convert the leaf to a SplitNode whose children have the target distribution returned by calling fn with the leaf's index. If fn returns an empty Seq, then the leaf is left as-is.

  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. def leafAt(leafIndex: Int, start: Node[K, V, T, A]): Option[LeafNode[K, V, T, A]]

    Returns the leaf with index leafIndex that is a descendant of start by performing a DFS starting with start.

  16. def leafAt(leafIndex: Int): Option[LeafNode[K, V, T, A]]

    Returns the leaf with index leafIndex by performing a DFS.

  17. def leafFor(row: Map[K, V], id: Option[String] = None)(implicit traversal: AnnotatedTreeTraversal[K, V, T, A]): Option[(Int, T, A)]

  18. def leafIndexFor(row: Map[K, V], id: Option[String] = None)(implicit traversal: AnnotatedTreeTraversal[K, V, T, A]): Option[Int]

  19. def mapAnnotation[A1](f: (A) ⇒ A1)(implicit arg0: Semigroup[A1]): AnnotatedTree[K, V, T, A1]

    Re-annotate the leaves of this tree using f to transform the annotations.

    Re-annotate the leaves of this tree using f to transform the annotations. This will then bubble the annotations up the tree using the Semigroup for A1. If f is a semigroup homomorphism, then this (semantically) just transforms the annotation at each node using f.

  20. def mapKeys[K1](f: (K) ⇒ K1): AnnotatedTree[K1, V, T, A]

    Maps the feature keys used to split the Tree using f.

  21. def mapPredicates[V1](f: (V) ⇒ V1)(implicit arg0: Ordering[V1]): AnnotatedTree[K, V1, T, A]

    Maps the Predicates in the Tree using f.

    Maps the Predicates in the Tree using f. Note, this will only produce a valid Tree if f preserves the ordering (ie if a.compare(b) == f(a).compare(f(b))).

  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. def prune[P, E](validationData: Map[Int, T], voter: Voter[T, P], error: Error[T, P, E])(implicit arg0: Ordering[E], m: Monoid[T], s: Semigroup[A]): AnnotatedTree[K, V, T, A]

    Prune a tree to minimize validation error.

    Prune a tree to minimize validation error.

    Recursively replaces each split with a leaf when it would have a lower error than the sum of the child leaves errors.

    validationData

    A Map from leaf index to validation data.

    voter

    to create predictions from target distributions.

    error

    to calculate an error statistic given observations (validation) and predictions (training).

    returns

    The new, pruned tree.

  26. def pruneLevel[P, E](parent: SplitNode[K, V, T, A], leftChild: LeafNode[K, V, T, A], rightChild: LeafNode[K, V, T, A], validationData: Map[Int, T], voter: Voter[T, P], error: Error[T, P, E])(implicit targetMonoid: Monoid[T], errorOrdering: Ordering[E]): (Map[Int, T], Node[K, V, T, A])

    Test conditions and optionally replace parent with a new leaf that combines children.

    Test conditions and optionally replace parent with a new leaf that combines children.

    Also merges validation data for any combined leaves. This relies on a hack that assumes no leaves have negative indices to start out.

    parent
    returns

  27. def pruneNode[P, E](validationData: Map[Int, T], start: Node[K, V, T, A], voter: Voter[T, P], error: Error[T, P, E])(implicit arg0: Ordering[E], m: Monoid[T], aSemigroup: Semigroup[A]): (Map[Int, T], Node[K, V, T, A])

    Prune a tree to minimize validation error, starting from given root node.

    Prune a tree to minimize validation error, starting from given root node.

    This method recursively traverses the tree from the root, branching on splits, until it finds leaves, then goes back down the tree combining leaves when such a combination would reduce validation error.

    validationData

    Map from leaf index to validation data.

    start

    The root node of the tree.

    returns

    A node at the root of the new, pruned tree.

  28. def renumberLeaves: AnnotatedTree[K, V, T, A]

    Renumber all leaves in the tree.

    Renumber all leaves in the tree.

    returns

    A new tree with leaves renumbered.

  29. val root: Node[K, V, T, A]

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def targetFor(row: Map[K, V], id: Option[String] = None)(implicit traversal: AnnotatedTreeTraversal[K, V, T, A], semigroup: Semigroup[T]): Option[T]

  32. def updateByLeafIndex(fn: (Int) ⇒ Option[Node[K, V, T, A]])(implicit s: Semigroup[A]): AnnotatedTree[K, V, T, A]

    For each LeafNode in this tree, this will replace it with the node returned from fn (called with the leaf node's index), if it returns Some node.

    For each LeafNode in this tree, this will replace it with the node returned from fn (called with the leaf node's index), if it returns Some node. Otherwise, if fn returns None, then the leaf node is left as-is.

  33. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped