Object/Class

com.eharmony.aloha.dataset.vw.multilabel

VwDownsampledMultilabelRowCreator

Related Docs: class VwDownsampledMultilabelRowCreator | package multilabel

Permalink

object VwDownsampledMultilabelRowCreator extends Rand with Serializable

Linear Supertypes
Serializable, Serializable, Rand, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. VwDownsampledMultilabelRowCreator
  2. Serializable
  3. Serializable
  4. Rand
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Index = Int

    Permalink
    Definition Classes
    Rand
  2. final class Producer[A, K] extends PositiveLabelsFunction[A, K] with StatefulRowCreatorProducer[A, Array[String], Long, VwDownsampledMultilabelRowCreator[A, K]] with RowCreatorProducerName with VwCovariateProducer[A] with DvProducer with SparseCovariateProducer with CompilerFailureMessages

    Permalink

    A producer that can produce a VwDownsampledMultilabelRowCreator.

    A producer that can produce a VwDownsampledMultilabelRowCreator. The requirement for StatefulRowCreatorProducer to only have zero-argument constructors is relaxed for this Producer because we don't have a way of generically constructing a list of labels. If the labels were encoded in the JSON, then a JsonReader for the label type would have to be passed to the constructor. Since the labels can't be encoded generically in the JSON, we accept that this Producer is a special case and allow the labels to be passed directly. The consequence is that this producer doesn't just rely on the dataset specification and the data itself. It also relying on the labels provided to the constructor.

    A

    type of input passed to the StatefulRowCreator.

    K

    the label type.

  3. type Seed = Long

    Permalink
    Definition Classes
    Rand

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. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. def initSeedScramble(seed: Seed): Seed

    Permalink

    Perform the initial scramble.

    Perform the initial scramble. This should be called once on the initial seed prior to the first call to sampleCombination.

    seed

    an initial seed

    returns

    a more scrambled seed.

    Attributes
    protected
    Definition Classes
    Rand
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  16. def sampleCombination(n: Int, k: Int, seed: Seed): (Array[Index], Seed)

    Permalink

    Sample a k-combination from a population of n.

    Sample a k-combination from a population of n.

    This algorithm uses a linear congruential pseudorandom number generator (see Knuth) to perform reservoir sampling via "Algorithm R".

    It is ~ O(n).

    If nk, then return 0, ..., n - 1; otherwise, if k < n, the returned array have length k with values between 0 and n - 1 (inclusive) but it is NOT guaranteed to be sorted.

    NOTE: This is a pure function. It produces the same results as if java.util.Random was used to perform reservoir sampling but since it doesn't carry state, this can be trivially operated in parallel with no locking or CAS loop overhead. The consequence is that the seed must be provided on every call and a new seed will be returned as part of the output.

    To get this function to act like java.util.Random, the first time it is called, the seed should be produce by running the desired seed through initSeedScramble. For instance:

    val (kComb1, newSeed1) = sampleCombination(4, 2, initSeedScramble(0))
    val (kComb2, newSeed2) = sampleCombination(4, 2, newSeed1)

    For more information, see:

    n

    population size

    k

    combination size

    seed

    the seed to use for random selection

    returns

    a tuple 2 containing the array of 0-based indices representing the k-combination and a new random seed.

    Attributes
    protected
    Definition Classes
    Rand
  17. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from Rand

Inherited from AnyRef

Inherited from Any

Ungrouped