Class/Object

com.eharmony.aloha.models.tree.decision

LinearNodeSelector

Related Docs: object LinearNodeSelector | package decision

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

    predicates

    The number of predicates must equal the number of nodes

Type Members

  1. 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

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(a: A): Int

    Permalink

    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

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

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

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

    Permalink
    Definition Classes
    AnyRef
  8. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    Any
  12. 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
  13. val missingDataOk: Boolean

    Permalink
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

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

    Permalink

    The number of predicates must equal the number of nodes

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

    Permalink

    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)

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

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

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

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

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

    Permalink
    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