For use from Java/minimizing code bloat in scala
For use from Java/minimizing code bloat in scala
For use from Java/minimizing code bloat in scala
This is a wrapper around SummingCache that attempts to grow the capacity by up to some maximum, as long as there's enough RAM.
An IndexedSeq that automatically switches representation between dense and sparse depending on sparsity Should be an efficient representation for all sizes, and it should not be necessary to special case immutable algebras based on the sparsity of the vectors.
This is for the case where your Ring[T] is a Rng (i.
Represents functions of the kind: f(x) = slope * x + intercept
This feeds the value in on the LEFT!!! This may seem counter intuitive, but with this approach, a stream/iterator which is summed will have the same output as applying the function one at a time in order to the input.
This is a type that models map/reduce(map).
Aggregators are Applicatives, but this hides the middle type.
Simple implementation of an Applicative type-class.
Group and Ring ARE NOT AUTOMATIC.
This is a Monoid, for all Applicatives.
This enrichment allows us to use our Applicative instances in for expressions: if (import Applicative.
Group and Ring ARE NOT AUTOMATIC.
This is a Semigroup, for all Applicatives.
Extends pair-wise sum Array monoid into a Group negate is defined as the negation of each element of the array.
Pair-wise sum Array monoid.
Tracks the count and mean value of Doubles in a data stream.
Bloom Filter data structure
Bloom Filter with 1 value.
Empty bloom filter.
Batched: the free semigroup.
Compacting monoid for batched values.
Compacting semigroup for batched values.
Bloom Filter - a probabilistic data structure to test presence of an element.
Represents something that consumes I and may emit O.
This never emits on put, you must call flush designed to be use in the stackable pattern with ArrayBufferedOperation
A wrapper for Array[Byte]
that provides sane implementations of hashCode
, equals
, and toString
.
A Count-Min sketch data structure that allows for counting and frequency estimation of elements in a data stream.
An Aggregator for CMS.
A trait for CMS implementations that can count elements in a data stream and that can answer point queries (i.
The Count-Min sketch uses d
(aka depth
) pair-wise independent hash functions drawn from a universal hashing
family of the form:
A trait for CMS implementations that can track heavy hitters in a data stream.
The general Count-Min sketch structure, used for holding any number of elements.
Used for holding a single element, to avoid repeatedly adding elements from sparse counts tables.
Monoid for adding CMS sketches.
Configuration parameters for CMS.
This mutable builder can be used when speed is essential and you can be sure the scope of the mutability cannot escape in an unsafe way.
Zero element.
These are the individual instances which the Monoid knows how to add
Either semigroup is useful for error handling.
Classes that support algebraic structures with dynamic switching between two representations, the original type O and the eventual type E.
Exponential Histogram algorithm from http://www-cs-students.
To keep code using algebird.
To keep code using algebird.Field compiling, we export algebra Field
Tracks the "least recent", or earliest, wrapped instance of T
by
the order in which items are seen.
Aggregator that selects the first instance of T
in the
aggregated stream.
A Preparer that has had one or more flatMap operations applied.
Folds are first-class representations of "Traversable.
Folds are Applicatives!
A FoldState defines a left fold with a "hidden" accumulator type.
Function1 monoid.
Simple implementation of a Functor type-class.
This enrichment allows us to use our Functor instances in for expressions: if (import Functor.
You can think of this as a Sparse vector ring
Group: this is a monoid that also has subtraction (and negation): So, you can do (a-b), or -a (which is equal to 0 - a).
HLLSeries can produce a HyperLogLog counter for any window into the past, using a constant factor more space than HyperLogLog.
A typeclass to represent hashing to 128 bits.
Containers for holding heavy hitter items and their associated counts.
Controls how a CMS that implements CMSHeavyHitters tracks heavy hitters.
val hllSeriesMonoid = new HyperLogLogSeriesMonoid(bits)
Note that this works similar to Semigroup[Map[Int,T]] not like Semigroup[List[T]] This does element-wise operations, like standard vector math, not concatenation, like Semigroup[String] or Semigroup[List[T]]
Represents a single interval on a T with an Ordering
Since Lists are mutable, this always makes a full copy.
Since maps are mutable, this always makes a full copy.
Tracks the "most recent", or last, wrapped instance of T
by the
order in which items are seen.
Aggregator that selects the last instance of T
in the
aggregated stream.
List concatenation monoid.
You can think of this as a Sparse vector group
A Preparer that has had zero or more map transformations applied, but no flatMaps.
Tracks the maximum wrapped instance of some ordered type T
.
Aggregator that selects the maximum instance of T
in the
aggregated stream.
Tracks the minimum wrapped instance of some ordered type T
.
Aggregator that selects the minimum instance of T
in the
aggregated stream.
MinHasher as a Monoid operates on this class to avoid the too generic Array[Byte].
Instances of MinHasher can create, combine, and compare fixed-sized signatures of arbitrarily sized sets.
A class to calculate the first five central moments over a sequence of Doubles.
Simple implementation of a Monad type-class.
This enrichment allows us to use our Monad instances in for expressions: if (import Monad.
Monoid (take a deep breath, and relax about the weird name): This is a semigroup that has an additive identity (called zero), such that a+0=a, 0+a=a, for every a
Some(5) - Some(3) == Some(2) Some(5) - Some(5) == None negate Some(5) == Some(-5) Note: Some(0) and None are equivalent under this Group
Some(5) + Some(3) == Some(8) Some(5) + None == Some(5)
This is a typeclass to represent things which are countable down.
Preparer is a way to build up an Aggregator through composition using a more natural API: it allows you to start with the input type and describe a series of transformations and aggregations from there, rather than starting from the aggregation and composing "outwards" in both directions.
Priority is a type class for prioritized implicit search.
Combine 10 groups into a product group
Combine 10 monoids into a product monoid
Combine 10 rings into a product ring
Combine 10 semigroups into a product semigroup
Combine 11 groups into a product group
Combine 11 monoids into a product monoid
Combine 11 rings into a product ring
Combine 11 semigroups into a product semigroup
Combine 12 groups into a product group
Combine 12 monoids into a product monoid
Combine 12 rings into a product ring
Combine 12 semigroups into a product semigroup
Combine 13 groups into a product group
Combine 13 monoids into a product monoid
Combine 13 rings into a product ring
Combine 13 semigroups into a product semigroup
Combine 14 groups into a product group
Combine 14 monoids into a product monoid
Combine 14 rings into a product ring
Combine 14 semigroups into a product semigroup
Combine 15 groups into a product group
Combine 15 monoids into a product monoid
Combine 15 rings into a product ring
Combine 15 semigroups into a product semigroup
Combine 16 groups into a product group
Combine 16 monoids into a product monoid
Combine 16 rings into a product ring
Combine 16 semigroups into a product semigroup
Combine 17 groups into a product group
Combine 17 monoids into a product monoid
Combine 17 rings into a product ring
Combine 17 semigroups into a product semigroup
Combine 18 groups into a product group
Combine 18 monoids into a product monoid
Combine 18 rings into a product ring
Combine 18 semigroups into a product semigroup
Combine 19 groups into a product group
Combine 19 monoids into a product monoid
Combine 19 rings into a product ring
Combine 19 semigroups into a product semigroup
Combine 20 groups into a product group
Combine 20 monoids into a product monoid
Combine 20 rings into a product ring
Combine 20 semigroups into a product semigroup
Combine 21 groups into a product group
Combine 21 monoids into a product monoid
Combine 21 rings into a product ring
Combine 21 semigroups into a product semigroup
Combine 22 groups into a product group
Combine 22 monoids into a product monoid
Combine 22 rings into a product ring
Combine 22 semigroups into a product semigroup
Combine 2 groups into a product group
Combine 2 monoids into a product monoid
Combine 2 rings into a product ring
Combine 2 semigroups into a product semigroup
Combine 3 groups into a product group
Combine 3 monoids into a product monoid
Combine 3 rings into a product ring
Combine 3 semigroups into a product semigroup
Combine 4 groups into a product group
Combine 4 monoids into a product monoid
Combine 4 rings into a product ring
Combine 4 semigroups into a product semigroup
Combine 5 groups into a product group
Combine 5 monoids into a product monoid
Combine 5 rings into a product ring
Combine 5 semigroups into a product semigroup
Combine 6 groups into a product group
Combine 6 monoids into a product monoid
Combine 6 rings into a product ring
Combine 6 semigroups into a product semigroup
Combine 7 groups into a product group
Combine 7 monoids into a product monoid
Combine 7 rings into a product ring
Combine 7 semigroups into a product semigroup
Combine 8 groups into a product group
Combine 8 monoids into a product monoid
Combine 8 rings into a product ring
Combine 8 semigroups into a product semigroup
Combine 9 groups into a product group
Combine 9 monoids into a product monoid
Combine 9 rings into a product ring
Combine 9 semigroups into a product semigroup
QTree aggregator is an aggregator that can be used to find the approximate percentile bounds.
QTreeAggregatorLowerBound is an aggregator that is used to find an appoximate percentile.
Used to represent cases where we need to periodically reset a + b = a + b |a + b = |(a + b) a + |b = |b |a + |b = |b
Ring: Group + multiplication (see: http://en.
Basically a specific implementation of the RightFoldedMonoid gradient is the gradient of the function to be minimized To use this, you need to insert an initial weight SGDWeights before you start adding SGDPos objects.
K1 defines a scope for the CMS.
A semigroup is any type T
with an associative operation (plus
):
This is a combinator on semigroups, after you do the plus, you transform B with a fold function This will not be valid for all fold functions.
This is a summing cache whose goal is to grow until we run out of memory, at which point it clears itself and stops growing.
SetDiff
is a class that represents changes applied to a set.
Set union monoid.
convert is not not implemented here
Use a Hash128 when converting to HLL, rather than an implicit conversion to Array[Byte] Unifying with SetSizeAggregator would be nice, but since they only differ in an implicit parameter, scala seems to be giving me errors.
An Aggregator for the SketchMap.
Hashes an arbitrary key type to one that the Sketch Map can use.
Responsible for creating instances of SketchMap.
Convenience class for holding constant parameters of a Sketch Map.
Data structure used in the Space-Saving Algorithm to find the approximate most frequent and top-k elements.
A sparse Count-Min sketch structure, used for situations where the key is highly skewed.
A Stateful summer is something that is potentially more efficient (a buffer, a cache, etc.
This is a typeclass to represent things which increase.
Sum the entire iterator one item at a time.
A Stateful Summer on Map[K,V] that keeps a cache of recent keys
A SummingCache that also tracks the number of key hits
A Count-Min sketch data structure that allows for (a) counting and frequency estimation of elements in a data stream and (b) tracking the heavy hitters among these elements.
Used for holding a single element, to avoid repeatedly adding elements from sparse counts tables.
Zero element.
A top-k monoid that is much faster than SortedListTake equivalent to: (left ++ right).
An Aggregator for TopNCMS.
Monoid for top-N based TopCMS sketches.
Tracks the top N heavy hitters, where N
is defined by heavyHittersN
.
An Aggregator for TopPctCMS.
Monoid for Top-% based TopCMS sketches.
Finds all heavy hitters, i.
Combine 10 groups into a product group
Combine 10 monoids into a product monoid
Combine 10 rings into a product ring
Combine 10 semigroups into a product semigroup
Combine 11 groups into a product group
Combine 11 monoids into a product monoid
Combine 11 rings into a product ring
Combine 11 semigroups into a product semigroup
Combine 12 groups into a product group
Combine 12 monoids into a product monoid
Combine 12 rings into a product ring
Combine 12 semigroups into a product semigroup
Combine 13 groups into a product group
Combine 13 monoids into a product monoid
Combine 13 rings into a product ring
Combine 13 semigroups into a product semigroup
Combine 14 groups into a product group
Combine 14 monoids into a product monoid
Combine 14 rings into a product ring
Combine 14 semigroups into a product semigroup
Combine 15 groups into a product group
Combine 15 monoids into a product monoid
Combine 15 rings into a product ring
Combine 15 semigroups into a product semigroup
Combine 16 groups into a product group
Combine 16 monoids into a product monoid
Combine 16 rings into a product ring
Combine 16 semigroups into a product semigroup
Combine 17 groups into a product group
Combine 17 monoids into a product monoid
Combine 17 rings into a product ring
Combine 17 semigroups into a product semigroup
Combine 18 groups into a product group
Combine 18 monoids into a product monoid
Combine 18 rings into a product ring
Combine 18 semigroups into a product semigroup
Combine 19 groups into a product group
Combine 19 monoids into a product monoid
Combine 19 rings into a product ring
Combine 19 semigroups into a product semigroup
Combine 20 groups into a product group
Combine 20 monoids into a product monoid
Combine 20 rings into a product ring
Combine 20 semigroups into a product semigroup
Combine 21 groups into a product group
Combine 21 monoids into a product monoid
Combine 21 rings into a product ring
Combine 21 semigroups into a product semigroup
Combine 22 groups into a product group
Combine 22 monoids into a product monoid
Combine 22 rings into a product ring
Combine 22 semigroups into a product semigroup
Combine 2 groups into a product group
Combine 2 monoids into a product monoid
Combine 2 rings into a product ring
Combine 2 semigroups into a product semigroup
Combine 3 groups into a product group
Combine 3 monoids into a product monoid
Combine 3 rings into a product ring
Combine 3 semigroups into a product semigroup
Combine 4 groups into a product group
Combine 4 monoids into a product monoid
Combine 4 rings into a product ring
Combine 4 semigroups into a product semigroup
Combine 5 groups into a product group
Combine 5 monoids into a product monoid
Combine 5 rings into a product ring
Combine 5 semigroups into a product semigroup
Combine 6 groups into a product group
Combine 6 monoids into a product monoid
Combine 6 rings into a product ring
Combine 6 semigroups into a product semigroup
Combine 7 groups into a product group
Combine 7 monoids into a product monoid
Combine 7 rings into a product ring
Combine 7 semigroups into a product semigroup
Combine 8 groups into a product group
Combine 8 monoids into a product monoid
Combine 8 rings into a product ring
Combine 8 semigroups into a product semigroup
Combine 9 groups into a product group
Combine 9 monoids into a product monoid
Combine 9 rings into a product ring
Combine 9 semigroups into a product semigroup
In some legacy cases, we have implemented Rings where we lacked the full laws.
In some legacy cases, we have implemented Rings where we lacked the full laws.
Convenience case class defined with a monoid for aggregating elements over a finite window.
Provides a natural monoid for combining windows truncated to some window size.
A super lightweight (hopefully) version of BitSet
Some functions to create or convert AdaptiveVectors
Aggregators compose well.
Boolean AND monoid.
Follows the type-class pattern for the Applicative trait
Group implementation for AveragedValue.
Provides a set of operations needed to create and use AveragedValue instances.
Aggregator that uses AveragedValue to calculate the mean
of all Double
values in the stream.
Helper functions to generate or to translate between various CMS parameters (cf.
This formerly held the instances that moved to object CMSHasher
Represents a container class together with time.
Provides a set of operations and typeclass instances needed to use First instances.
Methods to create and run Folds.
Follows the type-class pattern for the Functor trait
This gives default hashes using Murmur128 with a seed of 12345678 (for no good reason, but it should not be changed lest we break serialized HLLs)
Implementation of the HyperLogLog approximate counting as a Monoid
This object makes it easier to create Aggregator instances that use HLL
Provides a set of operations and typeclass instances needed to use Last instances.
Provides a set of operations and typeclass instances needed to use Max instances.
A Metric[V] m is a function (V, V) => Double that satisfies the following properties:
Provides a set of operations and typeclass instances needed to use Min instances.
A monoid to perform moment calculations.
Follows the type-class pattern for the Monad trait
Boolean OR monoid.
A QTree provides an approximate Map[Double,A:Monoid] suitable for range queries, quantile queries, and combinations of these (for example, if you use a numeric A, you can derive the inter-quartile mean).
This is an associative, but not commutative monoid Also, you must start on the right, with a value, and all subsequent RightFolded must be RightFoldedToFold objects or zero
This monoid takes a list of values of type In or Out, and folds to the right all the Ins into Out values, leaving you with a list of Out values, then finally, maps those outs onto Acc, where there is a group, and adds all the Accs up.
Data structure representing an approximation of Map[K, V], where V has an implicit ordering and monoid.
Creates an Iterator that emits partial sums of an input Iterator[V].
This class represents a vector space.
This is here to ease transition to using algebra.