Class

com.eharmony.aloha.models.tree.decision

RandomNodeSelector

Related Doc: package decision

Permalink

case class RandomNodeSelector[-A](features: Seq[GenAggFunc[A, Any]], distribution: HashedCategoricalDistribution, missingOk: Boolean = false) extends NodeSelector[A] with Product with Serializable

A selector that random selects a child node.

A

the input type from which features are extracted.

features

features on which the hash is based. Notice that function output type is Any.

distribution

a distribution used for selecting values.

missingOk

whether it is OK to hash on missing data. Keep in mind that if set to true, there is no guarantee about what value will be selected. (Missing data in this context means None. There are no explicit null checks; just None checks.)

Linear Supertypes
Serializable, Serializable, Product, Equals, NodeSelector[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RandomNodeSelector
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. NodeSelector
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RandomNodeSelector(features: Seq[GenAggFunc[A, Any]], distribution: HashedCategoricalDistribution, missingOk: Boolean = false)

    Permalink

    features

    features on which the hash is based. Notice that function output type is Any.

    distribution

    a distribution used for selecting values.

    missingOk

    whether it is OK to hash on missing data. Keep in mind that if set to true, there is no guarantee about what value will be selected. (Missing data in this context means None. There are no explicit null checks; just None checks.)

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. def apply(a: A): Int

    Permalink

    "Randomly" but idempotently pick an index of a sub-tree down which to branch.

    "Randomly" but idempotently pick an index of a sub-tree down which to branch. Compute a uniformly distributed hash code from the features specified to the constructor and then use it to drive alias method sampling to select a sub-tree branch with the desired probability. Since the uniformly generated variates are based on hashing rather than a random number generator, the selection is idempotent.

    Note: This uses the MurmurHash3 singleton in Scala rather than Guava's com.google.common.hash.Hashing.murmur3_32 implementation for speed and compatibility with Scala. Therefore, there should be no expectation that the hashcodes produced by the different methods will produce the same hashes on the same data.

    a

    input from which features are extracted. These features are then hashed to produce a value.

    returns

    a positive value i if node i should be selected. May return a negative value in which case processErrorAt should be called with the value returned.

    Definition Classes
    RandomNodeSelector → NodeSelector
  5. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val distribution: HashedCategoricalDistribution

    Permalink

    a distribution used for selecting values.

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

    Permalink
    Definition Classes
    AnyRef
  9. val features: Seq[GenAggFunc[A, Any]]

    Permalink

    features on which the hash is based.

    features on which the hash is based. Notice that function output type is Any.

  10. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. val missingOk: Boolean

    Permalink

    whether it is OK to hash on missing data.

    whether it is OK to hash on missing data. Keep in mind that if set to true, there is no guarantee about what value will be selected. (Missing data in this context means None. There are no explicit null checks; just None checks.)

  14. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  17. def processErrorAt(a: A, i: Int): ErrorsAndMissing

    Permalink

    Process an error.

    Process an error.

    a

    input to decision tree model

    i

    the value returned by apply. This should be a negative number whose absolute value represents the index of the feature that contained missing data.

    Definition Classes
    RandomNodeSelector → NodeSelector
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  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 Product

Inherited from Equals

Inherited from NodeSelector[A]

Inherited from AnyRef

Inherited from Any

Ungrouped