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.
- Alphabetic
- By Inheritance
- FeaturePowerSetTerms
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new FeaturePowerSetTerms(maxFeatures: Int)
- maxFeatures
number of features to allocate space for
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def copy(): FeaturePowerSetTerms
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- 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)
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- var size: Int
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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
- def unwind(weightWhenExcluded: Double, weightWhenIncluded: Double): FeaturePowerSetTerms
Remove a feature from the power set, reversing the action of the
extendmethodRemove a feature from the power set, reversing the action of the
extendmethodThis 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)
- 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.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- val weightBySubsetSize: Array[Double]