class Frequency[T] extends Stat
Estimates frequency counts at scale
- T
type parameter, should match the type binding of the attribute
- Alphabetic
- By Inheritance
- Frequency
- Stat
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Frequency(sft: SimpleFeatureType, property: String, dtg: Option[String], period: TimePeriod, precision: Int, eps: Double = 0.005, confidence: Double = 0.95)(implicit ct: ClassTag[T])
- sft
simple feature type
- property
attribute the sketch is being made for
- dtg
primary date attribute of the sft, if there is one
- period
time period to use for splitting by date
- precision
for geometry types, this is the number of bits of z-index to keep (max of 64) (note: first 2 bits do not hold any info) for date types, this is the number of milliseconds to group for binning for number types, this is the number of digits that will be grouped together for floating point types, this is the number of decimal places that will be considered for string types, this is the number of characters that will be considered
- eps
(epsilon) with probability at least @see confidence, estimates will be within eps * N
- confidence
percent - with probability at least confidence, estimates will be within @see eps * N
- ct
class tag
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: Frequency[T]): Frequency[T]
Combine two stats into a new stat
-
def
+(other: Stat)(implicit d: DummyImplicit): Stat
Non type-safe add - if stats are not the same type, will throw an exception
Non type-safe add - if stats are not the same type, will throw an exception
- other
the other stat to add
- Definition Classes
- Stat
-
def
+=(other: Frequency[T]): Unit
Add another stat to this stat.
-
def
+=(other: Stat)(implicit d: DummyImplicit): Unit
Non type-safe add - if stats are not the same type, will throw an exception
Non type-safe add - if stats are not the same type, will throw an exception
- other
the other stat to add
- Definition Classes
- Stat
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clear(): Unit
Clears the stat to its original state when first initialized.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
- val confidence: Double
-
def
count(timeBin: Short, value: T): Long
Gets the count for a given value in a particular time bin
Gets the count for a given value in a particular time bin
- timeBin
period since the epoch
- value
value to consider
- returns
count of the value
-
def
count(value: T): Long
Gets the count for a given value, across all time bins
Gets the count for a given value, across all time bins
- value
value to consider
- returns
count of the value
-
def
countDirect(timeBin: Short, value: Long): Long
Gets the count for a given value, which has already been converted into a long.
Gets the count for a given value, which has already been converted into a long. Useful if you know the long key space ahead of time (e.g. with z-values).
- timeBin
period since the epoch
- value
value to consider, converted into an appropriate long key
- returns
count of the value
-
def
countDirect(value: Long): Long
Gets the count for a given value, which has already been converted into a long, across all time bins.
Gets the count for a given value, which has already been converted into a long, across all time bins. Useful if you know the long key space ahead of time (e.g. with z-values).
- value
value to consider, converted into an appropriate long key
- returns
count of the value
-
def
countDirect(timeBin: Short, value: String): Long
Gets the count for a given value, which has already been converted into a string.
Gets the count for a given value, which has already been converted into a string. Useful if you know the string key space ahead of time.
- timeBin
period since the epoch
- value
value to consider, converted into an appropriate string key
- returns
count of the value
-
def
countDirect(value: String): Long
Gets the count for a given value, which has already been converted into a string, across all time bins.
Gets the count for a given value, which has already been converted into a string, across all time bins. Useful if you know the string key space ahead of time.
- value
value to consider, converted into an appropriate string key
- returns
count of the value
- implicit val ct: ClassTag[T]
- val dtg: Option[String]
- val eps: Double
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
isEmpty: Boolean
Necessary method used by the StatIterator.
-
def
isEquivalent(other: Stat): Boolean
Compares the two stats for equivalence.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
def
observe(sf: SimpleFeature): Unit
Compute statistics based upon the given simple feature.
- val period: TimePeriod
- val precision: Int
- val property: String
-
val
sft: SimpleFeatureType
The simple feature type that this stat operates on
-
def
size(timeBin: Short): Long
Number of observations in the frequency map
Number of observations in the frequency map
- returns
number of observations
-
def
size: Long
Number of observations in the frequency map
Number of observations in the frequency map
- returns
number of observations
-
def
splitByTime: Seq[(Short, Frequency[T])]
Split the stat into a separate stat per time bin of z data.
Split the stat into a separate stat per time bin of z data. Allows for separate handling of the reduced data set.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
timeBins: Seq[Short]
Gets the time bins covered by this frequency
-
def
toJson: String
Returns a JSON representation of the Stat
-
def
toJsonObject: ListMap[String, AnyVal]
Returns a representation of the Stat to be serialized
Returns a representation of the Stat to be serialized
This function should return a representation (view) of the Stat to be serialized as JSON. Instances of Map can be used to represent JSON dictionaries or Seq for JSON arrays. A collection.SortedMap such as collection.immutable.ListMap is recommended if key order should be deterministic. Other types may be used but could require the creation and registration of custom serializers dependent on the JSON framework being utilized (currently Gson).
- returns
stat as a json serializable object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unobserve(sf: SimpleFeature): Unit
Tries to remove the given simple feature from the compiled statistics.
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated