Packages

c

io.citrine.lolo.trees

FeaturePowerSetTerms

class FeaturePowerSetTerms extends AnyRef

Weighted combinatorial factors corresponding to the power-set of features that are included

The set is extended as new features are encountered. Each element in weightBySubsetSize corresponds to all of the subsets of the features that are included vs excluded of a given size:

  • the 0th element corresponds to the term where all of the encountered features are excluded,
  • the 1st element sums the terms that have exactly one of the encountered feature included,
  • the 2nd element sums the terms that have exactly two of the encountered features included, and so on and so forth. The final element represents the single term where all of the features are "turned on".

The calculation is performed efficiently using a dynamic programming technique that runs in quadratic time with the number of features. It is described in the extend and unwind methods.

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

Instance Constructors

  1. new FeaturePowerSetTerms(maxFeatures: Int)

    maxFeatures

    number of features to allocate space for

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def copy(): FeaturePowerSetTerms
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def extend(weightWhenExcluded: Double, weightWhenIncluded: Double): FeaturePowerSetTerms

    Extend the power set by adding a new feature (in-place)

    Extend the power set by adding a new feature (in-place)

    Each subset weight is updated with a contribution from the subset of the same size multiplied by the weight when the feature is excluded and the subset of size one smaller multiplied by the weight when the feature is included. The additional terms in the expression track the combinatorial factors |S|! and (M - |S| - 1)! from eq. 2 of https://arxiv.org/pdf/1802.03888.pdf

    weightWhenExcluded

    weight factor for this node when the feature is excluded (unknown)

    weightWhenIncluded

    weight factor for this node when the feature is included (known)

    returns

    this (in-place)

  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. var size: Int
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. def totalWeight: Double

    Get the total weight of the feature power set, as a sum over the weights by size of the sets in the power set

  21. def unwind(weightWhenExcluded: Double, weightWhenIncluded: Double): FeaturePowerSetTerms

    Remove a feature from the power set, reversing the action of the extend method

    Remove a feature from the power set, reversing the action of the extend method

    This method is probably better called "remove", but it is called unwind in the paper. It's not pretty, but it simply inverts extend. If you think about extend as multiplying by a matrix with weightWhenExcluded... on the diagonal and weightWhenIncluded... on the lower diagonal. This method is performing a fast linear solve on that banded system, with the two logical branches corresponding to the banded vs purely diagonal case. The ... above denotes some combinatorial terms also present.

    returns

    feature power set with a feature removed (out-of-place)

  22. def unwoundTotalWeight(weightWhenExcluded: Double, weightWhenIncluded: Double): Double

    This is an optimized version of unwind().totalWeight.

    This is an optimized version of unwind().totalWeight. Because the unwound feature power set isn't used, it is not even allocated. That avoided allocation is a significant performance improvement.

  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. val weightBySubsetSize: Array[Double]

Inherited from AnyRef

Inherited from Any

Ungrouped