com.eharmony.aloha.models.tree.decision

LinearNodeSelector

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

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

Linear Supertypes
Serializable, Serializable, Product, Equals, EitherHelpers, NodeSelector[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. LinearNodeSelector
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. EitherHelpers
  7. NodeSelector
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LinearNodeSelector(predicates: List[GenAggFunc[A, Option[Boolean]]], missingDataOk: Boolean = false)

    predicates

    The number of predicates must equal the number of nodes

Type Members

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

    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

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 apply(a: A): Int

    Return: - a positive value on success - a negative index i to indicate a missing data for data at i

    Return: - a positive value on success - a negative index i to indicate a missing data for data at i

    a

    input to decision tree model

    returns

    Definition Classes
    LinearNodeSelector → NodeSelector
    Annotations
    @inline()
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def fromValidationNel[A](v: ValidationNel[String, A]): ENS[A]

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. def mapSeq[A, B](l: Seq[A])(f: (A) ⇒ ENS[B]): ENS[Seq[B]]

    Like l.

    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

    returns

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  15. val missingDataOk: Boolean

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

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

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

    Definition Classes
    AnyRef
  19. val predicates: List[GenAggFunc[A, Option[Boolean]]]

    The number of predicates must equal the number of nodes

  20. def processErrorAt(a: A, i: Int): ErrorsAndMissing

    Get error information.

    Get error information. NOTE: This function has a linear runtime in the branching factor of the decision tree in which it is employed.

    a

    input to decision tree model

    i

    the value returned by apply (this should be a negative number)

    returns

    Definition Classes
    LinearNodeSelector → NodeSelector
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def toValidationNel[A](e: ENS[A]): ValidationNel[String, A]

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  23. final def wait(): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. 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 EitherHelpers

Inherited from NodeSelector[A]

Inherited from AnyRef

Inherited from Any

Ungrouped