com.eharmony.aloha.models.tree.decision
The number of predicates must equal the number of nodes
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)
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
input to decision tree model
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))
type of values in the input sequence in the first parameter list.
type of values in the output sequence if successful.
list of values to which f should be applied.
function to map over l
The number of predicates must equal the number of nodes
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.
input to decision tree model
the value returned by apply (this should be a negative number)
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.
input type
The number of predicates must equal the number of nodes