Object

org.clulab.utils

MathUtils

Related Doc: package utils

Permalink

object MathUtils

Math utility methods useful for stats and ML User: mihais, dfried Date: 4/23/13

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MathUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class EnhancedNumericCollection[T, CT] extends AnyRef

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val LogTolerance: Double

    Permalink

    If a difference is bigger than this in log terms, then the sum or difference of them will just be the larger (to 12 or so decimal places for double, and 7 or 8 for float).

  5. val LogToleranceFloat: Float

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def denseSoftmax(vector: Array[Double], gamma: Double = 1.0): Array[Double]

    Permalink

    Puts a softmax layer over a collection of scores, so they look like probabilities

    Puts a softmax layer over a collection of scores, so they look like probabilities

    vector

    A collection of unnormalized scores

    gamma

    Indicates how spiked the probability distribution should be

  9. def denseSoftmaxFloat(vector: Array[Float], gamma: Float = 1.0f): Array[Float]

    Permalink

    Puts a softmax layer over a collection of scores, so they look like probabilities

    Puts a softmax layer over a collection of scores, so they look like probabilities

    vector

    A collection of unnormalized scores

    gamma

    Indicates how spiked the probability distribution should be

  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. def histogram(xs: Traversable[Double], numBuckets: Int): Map[(Double, Double), Int]

    Permalink
  16. def histogram(xs: Traversable[Double], boundaries: Seq[Double]): Map[(Double, Double), Int]

    Permalink
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def logSum(logInputs: IndexedSeq[Double], fromIndex: Int, toIndex: Int): Double

    Permalink

    Returns the log of the portion between fromIndex, inclusive, and toIndex, exclusive, of an array of numbers, which are themselves input in log form.

    Returns the log of the portion between fromIndex, inclusive, and toIndex, exclusive, of an array of numbers, which are themselves input in log form. This is all natural logarithms. Reasonable care is taken to do this as efficiently as possible (under the assumption that the numbers might differ greatly in magnitude), with high accuracy, and without numerical overflow. Throws an IllegalArgumentException if logInputs is of length zero. Otherwise, returns Double.NegativeInfinity if fromIndex >= toIndex.

    logInputs

    Numbers in log form

    fromIndex

    Start offset (inclusive)

    toIndex

    End offset (exclusive)

    returns

    log(x1 + ... + xn)

  19. def logSum(logInputs: IndexedSeq[Double]): Double

    Permalink
  20. def logSumFloat(logInputs: IndexedSeq[Float], fromIndex: Int, toIndex: Int): Float

    Permalink
  21. def logSumFloat(logInputs: IndexedSeq[Float]): Float

    Permalink
  22. def nBest[T](scoringFunction: (T) ⇒ Double)(xs: Iterable[T], howMany: Int)(implicit arg0: Manifest[T]): List[(T, Double)]

    Permalink
  23. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. def randomize[T](l: Array[T], rand: Random): Array[T]

    Permalink
  27. def round(d: Double, decimals: Int): Double

    Permalink

    Rounds a number between 0 and 1 to a percentage value, with up to the indicated number of decimals This is useful to pretty print P/R/F1 scores

  28. def sampleStream[T](xs: Iterable[T], howMany: Int)(implicit arg0: Manifest[T]): List[T]

    Permalink

    sample howMany elements uniformly from xs.

    sample howMany elements uniformly from xs. Doesn't retain order of xs

  29. def softmax(scores: Iterable[Double], gamma: Double = 1.0): IndexedSeq[Double]

    Permalink

    Puts a softmax layer over a collection of scores, so they look like probabilities

    Puts a softmax layer over a collection of scores, so they look like probabilities

    scores

    A collection of unnormalized scores

    gamma

    Indicates how spiked the probability distribution should be

  30. def softmaxFloat(scores: Iterable[Float], gamma: Float = 1.0f): IndexedSeq[Float]

    Permalink

    Puts a softmax layer over a collection of scores, so they look like probabilities

    Puts a softmax layer over a collection of scores, so they look like probabilities

    scores

    A collection of unnormalized scores

    gamma

    Indicates how spiked the probability distribution should be

  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped