Package

com.eharmony.aloha.models.tree

decision

Permalink

package decision

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. decision
  2. EitherHelpers
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class BasicDecisionTree[U, N, -A, +B <: U](modelId: ModelIdentity, root: Node[A, N], returnBest: Boolean, auditor: Auditor[U, N, B]) extends SubmodelBase[U, N, A, B] with Product with Serializable

    Permalink

    A decision tree whose node values are the values returned by this model.

    A decision tree whose node values are the values returned by this model.

    A

    model input type

    B

    model output type

    modelId

    An id with which to identify this model

    root

    the root node of the decision tree

    returnBest

    if no path from the root to a leaf can be generated for a given input, should we return a score associated with an interior node?

  2. trait DecisionTreeBoolToOptBoolConversions extends AnyRef

    Permalink
  3. trait DecisionTreeJson extends AnyRef

    Permalink
  4. type ENS[+A] = Either[Seq[String], A]

    Permalink

    Either of Non-empty Seq (Like poor man's version of ValidationNel from scalaz)

    Either of Non-empty Seq (Like poor man's version of ValidationNel from scalaz)

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  5. case class InteriorNode[-A, +B](value: B, descendants: IndexedSeq[Node[A, B]], nodeSelector: NodeSelector[A]) extends Node[A, B] with Product with Serializable

    Permalink
  6. case class Leaf[+B](value: B) extends Node[Any, B] with Product with Serializable

    Permalink

    Representation of a decision tree leaf node.

    Representation of a decision tree leaf node.

    B

    the domain of the childSelector function

    value

    a value stored in this leaf node.

  7. case class LinearNodeSelector[-A](predicates: List[GenAggFunc[A, Option[Boolean]]], missingDataOk: Boolean = false) extends NodeSelector[A] with EitherHelpers with Product with Serializable

    Permalink

    A linear time node selection algorithm that is based on applying the predicates in order to the input datum and selecting the first node whose associated predicate succeeds.

    A linear time node selection algorithm that is based on applying the predicates in order to the input datum and selecting the first node whose associated predicate succeeds. If no predicate succeeds, return an error.

    A

    input type

    predicates

    The number of predicates must equal the number of nodes

  8. case class ModelDecisionTree[U, N, -A, +B <: U](modelId: ModelIdentity, root: Node[A, Submodel[N, A, U]], returnBest: Boolean, auditor: Auditor[U, N, B]) extends SubmodelBase[U, N, A, B] with Product with Serializable

    Permalink

    A decision tree containing models at the nodes.

    A decision tree containing models at the nodes. The evaluation algorithm works as follows:

    • Given input a
    • Find the terminal node, n, in the tree using the standard decision tree algorithm
    • At node n, there exists a model, m.
    • Let o be the value of m evaluated at a.
    • o will be a subscore of this model and this model will also output the same score.

    If a

    The benefit to this is that we report which submodel was responsible for producing the score.

    A

    model input type

    B

    model output type

    modelId

    An id with which to identify this model

    root

    the root node of the decision tree

    returnBest

    if no path from the root to a leaf can be generated for a given input, should we return a score associated with an interior node?

  9. sealed trait Node[-A, +B] extends Tree[B, IndexedSeq, Node[A, B]]

    Permalink

    A simple representation of a decision tree node.

    A simple representation of a decision tree node. It is just like a com.eharmony.aloha.models.tree.Tree except that it has a way of choosing a descendant, given an input.

    A

    the type of node in the decision tree.

    B

    the domain of the childSelector function

  10. case class RandomNodeSelector[-A](features: Seq[GenAggFunc[A, Any]], distribution: HashedCategoricalDistribution, missingOk: Boolean = false) extends NodeSelector[A] with Product with Serializable

    Permalink

    A selector that random selects a child node.

    A selector that random selects a child node.

    A

    the input type from which features are extracted.

    features

    features on which the hash is based. Notice that function output type is Any.

    distribution

    a distribution used for selecting values.

    missingOk

    whether it is OK to hash on missing data. Keep in mind that if set to true, there is no guarantee about what value will be selected. (Missing data in this context means None. There are no explicit null checks; just None checks.)

Value Members

  1. object BasicDecisionTree extends ParserProviderCompanion with Serializable

    Permalink
  2. object DecisionTreeBoolToOptBoolConversions extends DecisionTreeBoolToOptBoolConversions

    Permalink
  3. object LinearNodeSelector extends Serializable

    Permalink
  4. object ModelDecisionTree extends ParserProviderCompanion with Serializable

    Permalink
  5. object Node

    Permalink

    Provides factory methods for creating Decision Tree nodes.

  6. def fromValidationNel[A](v: ValidationNel[String, A]): ENS[A]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  7. def mapSeq[A, B](l: Seq[A])(f: (A) ⇒ ENS[B]): ENS[Seq[B]]

    Permalink

    Like l.map(f).sequence[({type L[+A] = Either[Seq[String], A]})#L, C ] in scalaz except that it short circuits if it finds an error.

    Like l.map(f).sequence[({type L[+A] = Either[Seq[String], A]})#L, C ] in scalaz except that it short circuits if it finds an error. (There must be some better way to do this w/ scalaz).

    If we put a println("folding") at the top of the inner function h, we would get the following:

    scala> mapSeq(Left(Seq("1")) +: (2 to 3).map(Right(_)))(identity)  // Only 1 "folding" instead of 3.
    folding
    res0: ENS[Seq[Int]] = Left(List(0))
    
    scala> mapSeq((1 to 3).map(Right(_)))(identity)
    folding
    folding
    folding
    res1: ENS[Seq[Int]] = Right(List(1, 2, 3))
    A

    type of values in the input sequence in the first parameter list.

    B

    type of values in the output sequence if successful.

    l

    list of values to which f should be applied.

    f

    function to map over l

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  8. def toValidationNel[A](e: ENS[A]): ValidationNel[String, A]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    EitherHelpers

Inherited from EitherHelpers

Inherited from AnyRef

Inherited from Any

Ungrouped