Packages

case class Histogram[T](frequencies: Vector[Frequency[T]]) extends Product with Serializable

Generic class for working with frequency counts of items of a given type T.

frequencies

Vector of Frequency counts.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Histogram
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Histogram(frequencies: Vector[Frequency[T]])

    frequencies

    Vector of Frequency counts.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++(h2: Histogram[T]): Histogram[T]
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def cex(delimiter: String = "#"): String
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  8. def countForItem[T](item: T): Int
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. val frequencies: Vector[Frequency[T]]
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. def percent(n: Int): Int

    Compute percent of total entries.

    Compute percent of total entries. Crudely round down to Int value, e.g., percent(2) out of a total of 3 == 66, not 67.

    n

    What percent of the total in this histogram does the count n represent?

  17. def percentForCount(count: Int): Int

    Compute what percent of the histogram the total values up a given count constitute.

    Compute what percent of the histogram the total values up a given count constitute.

    count

    Threshhold count to include.

  18. def percentForItem[T](item: T): Int

    Compute what percent of the histogram the total values up to a given item's value represents.

    Compute what percent of the histogram the total values up to a given item's value represents. E.g., if for four entries with counts 4,3,2,1, the percent for subtotal at 3 is 70% (subtotal of 7 out of total of 10). Note that if multiple items have the same count as the requesteditem, their counts are included: we want the percent for all items with this count value.

    item

    What percent of the histogram does

  19. def size: Int

    Number of entries in the histogram.

  20. def sorted: Histogram[T]

    New histogram with frequencies sorted by count, descending.

  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. def takePercent(threshhold: Int, runningTotal: Int = 0, source: Vector[Frequency[T]] = sorted.frequencies, entries: Vector[Frequency[T]] = Vector.empty[Frequency[T]]): Vector[Frequency[T]]

    Return minimum number of frequencies with counts summing up to or beyond a percent threshhold by recursively extracting top entry and inspecting running total.

    Return minimum number of frequencies with counts summing up to or beyond a percent threshhold by recursively extracting top entry and inspecting running total.

    threshhold

    Percent of totals to extract.

    runningTotal

    Total of counts seen so far.

    source

    Vector of Frequencys remaining to consider.

    entries

    Vector of Frequencys extracted so far.

  23. def total: Int

    Total of all count values.

  24. def uniqueKeys: Boolean
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped