Package

framian

reduce

Permalink

package reduce

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. reduce
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class Exists[A] extends Reducer[A, Boolean]

    Permalink

    A Reducer that exististentially quantifies a predicate as a reduction over a collection of Cells.

    A Reducer that exististentially quantifies a predicate as a reduction over a collection of Cells.

    This reducer will return true upon encountering the first value that is available and meaningful and applying the predicate p to that value returns true. Otherwise, returns false.

    This reducer is unusual in that it will ignore NonValues, in particular, it will not propogate NM. If the predicate can be satisfied by a value that is available and meaningful elsewhere in the collection, then this reduction should still return true.

    This reducer will only traverse the entire collection if it never encounters an available and meaningful value that satisfies the predicate p.

    A

    the value type of the column to reduce.

    Example:
    1. Series.empty[Int, Int].reduce(new Exists[Int](i => true)) == Value(false)
      Series(1 -> 1, 2 -> 2).reduce(new Exists[Int](i => i < 2)) == Value(true)
      Series.fromCells[Int, Int](1 -> NA, 2 -> 1).reduce(new Exists[Int](i => i < 2)) == Value(true)
      Series.fromCells[Int, Int](1 -> NM, 2 -> 1).reduce(new Exists[Int](i => i < 2)) == Value(true)
    Note

    This reducer will always return precisely Value[Boolean], rather than Cell[Boolean]. This in constrast to most reducers that will also return NonValues.

    See also

    ForAll

  2. final class First[A] extends Reducer[A, A]

    Permalink
  3. final class FirstN[A] extends Reducer[A, List[A]]

    Permalink
  4. final class ForAll[A] extends Reducer[A, Boolean]

    Permalink

    A Reducer that universally quantifies a predicate as a reduction over a collection of Cells.

    A Reducer that universally quantifies a predicate as a reduction over a collection of Cells.

    This reducer will return false upon encountering the first value that is not meaningful, or the first value that is available and meaningful and applying the predicate p to that value returns false. Otherwise, returns true.

    This reducer does propogate NM, in a sense, but the result is Value(false) rather than NM. Unavailable values (NA) are treated as the vaccuous case, so they will in count as a counter example to the quantification.

    This reducer will only traverse the entire collection if it never encounters a not meaningful value or a meaningful value that does not satisfy the predicate p.

    A

    the value type of the column to reduce.

    Example:
    1. Series.empty[Int, Int].reduce(new ForAll[Int](i => false)) == Value(true)
      Series(1 -> 1, 2 -> 2).reduce(new ForAll[Int](i => i < 3)) == Value(true)
      Series(1 -> 1, 2 -> 2).reduce(new ForAll[Int](i => i < 2)) == Value(false)
      Series.fromCells[Int, Int](1 -> NA)        .reduce(new ForAll[Int](i => false)) == Value(true)
      Series.fromCells[Int, Int](1 -> 1, 2 -> NM).reduce(new ForAll[Int](i => i < 2)) == Value(false)
    Note

    This reducer will always return precisely Value[Boolean], rather than Cell[Boolean]. This in constrast to most reducers that will also return NonValues.

    See also

    Exists

  5. final class Last[A] extends Reducer[A, A]

    Permalink
  6. final class LastN[A] extends Reducer[A, List[A]]

    Permalink
  7. final class Max[A] extends Reducer[A, A]

    Permalink
  8. final class Mean[A] extends Reducer[A, A]

    Permalink
  9. final class Median[A] extends SimpleReducer[A, A]

    Permalink
  10. class MonoidReducer[A] extends Reducer[A, A]

    Permalink
  11. final class Outliers[A] extends SimpleReducer[A, (Option[A], Option[A])]

    Permalink
  12. final class Quantile[A] extends SimpleReducer[A, List[(Double, A)]]

    Permalink
  13. trait Reducer[-A, +B] extends AnyRef

    Permalink

    A low level trait for implementing reductions.

    A low level trait for implementing reductions.

    TODO: All reducers should return Cell[B].

    A

    the input type of the reducer, which is the value type of the input Column

    B

    the ouput type of the reducer, which is the value type of the output Cell

  14. class SemigroupReducer[A] extends Reducer[A, A]

    Permalink
  15. abstract class SimpleReducer[A, B] extends Reducer[A, B]

    Permalink
  16. final class Unique[A] extends Reducer[A, Set[A]]

    Permalink

Value Members

  1. object Count extends Reducer[Any, Int]

    Permalink
  2. def Exists[A](p: (A) ⇒ Boolean): Reducer[A, Boolean]

    Permalink

    Returns a Reducer that exististentially quantifies a predicate as a reduction over a collection of Cells.

    Returns a Reducer that exististentially quantifies a predicate as a reduction over a collection of Cells.

    This reducer will return true upon encountering the first value that is available and meaningful and applying the predicate p to that value returns true. Otherwise, returns false.

    This reducer is unusual in that it will ignore NonValues, in particular, it will not propogate NM. If the predicate can be satisfied by a value that is available and meaningful elsewhere in the collection, then this reduction should still return true.

    This reducer will only traverse the entire collection if it never encounters an available and meaningful value that satisfies the predicate p.

    A

    the value type of the column to reduce.

    p

    the predicate to apply to the values of the column.

    returns

    a Reducer that exististentially quantifies a predicate.

    Example:
    1. Series.empty[Int, Int].reduce(Exists[Int](i => true)) == Value(false)
      Series(1 -> 1, 2 -> 2).reduce(Exists[Int](i => i < 2)) == Value(true)
      Series.fromCells[Int, Int](1 -> NA, 2 -> 1).reduce(Exists[Int](i => i < 2)) == Value(true)
      Series.fromCells[Int, Int](1 -> NM, 2 -> 1).reduce(Exists[Int](i => i < 2)) == Value(true)
    See also

    ForAll

  3. def First[A]: Reducer[A, A]

    Permalink
  4. def FirstN[A](n: Int): Reducer[A, List[A]]

    Permalink
  5. def ForAll[A](p: (A) ⇒ Boolean): Reducer[A, Boolean]

    Permalink

    Returns a Reducer that universally quantifies a predicate as a reduction over a collection of Cells.

    Returns a Reducer that universally quantifies a predicate as a reduction over a collection of Cells.

    This reducer will return false upon encountering the first value that is not meaningful, or the first value that is available and meaningful and applying the predicate p to that value returns false. Otherwise, returns true.

    This reducer does propogate NM, in a sense, but the result is Value(false) rather than NM. Unavailable values (NA) are treated as the vaccuous case, so they will in count as a counter example to the quantification.

    This reducer will only traverse the entire collection if it never encounters a not meaningful value or a meaningful value that does not satisfy the predicate p.

    A

    the value type of the column to reduce.

    p

    the predicate to apply to the values of the column.

    returns

    a Reducer that universally quantifies a predicate.

    Example:
    1. Series.empty[Int, Int].reduce(ForAll[Int](i => false)) == Value(true)
      Series(1 -> 1, 2 -> 2).reduce(ForAll[Int](i => i < 3)) == Value(true)
      Series(1 -> 1, 2 -> 2).reduce(ForAll[Int](i => i < 2)) == Value(false)
      Series.fromCells[Int, Int](1 -> NA)        .reduce(ForAll[Int](i => false)) == Value(true)
      Series.fromCells[Int, Int](1 -> 1, 2 -> NM).reduce(ForAll[Int](i => i < 2)) == Value(false)
    See also

    Exists

  6. def Last[A]: Reducer[A, A]

    Permalink
  7. def LastN[A](n: Int): Reducer[A, List[A]]

    Permalink
  8. def Max[A](implicit arg0: Order[A]): Reducer[A, A]

    Permalink
  9. def Mean[A](implicit arg0: Field[A]): Reducer[A, A]

    Permalink
  10. def Median[A](implicit arg0: Field[A], arg1: Order[A], arg2: ClassTag[A]): Reducer[A, A]

    Permalink
  11. def Min[A](implicit arg0: Order[A]): Reducer[A, A]

    Permalink
  12. def MonoidReducer[A](implicit arg0: Monoid[A]): Reducer[A, A]

    Permalink
  13. def Outliers[A](k: Double = 1.5)(implicit arg0: Field[A], arg1: Order[A], arg2: ClassTag[A]): Reducer[A, (Option[A], Option[A])]

    Permalink
  14. def Quantile[A](probabilities: Seq[Double] = Seq(0, .25, .5, .75, 1))(implicit arg0: Field[A], arg1: Order[A], arg2: ClassTag[A]): Reducer[A, Seq[(Double, A)]]

    Permalink
  15. def SemigroupReducer[A](implicit arg0: Semigroup[A]): Reducer[A, A]

    Permalink
  16. def Sum[A](implicit arg0: AdditiveMonoid[A]): Reducer[A, A]

    Permalink
  17. def Unique[A]: Reducer[A, Set[A]]

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped