ThompsonTreePosterior
data class ThompsonTreePosterior(val priorWeight: Double = 1.0, val priorVariance: Double = 1.0) : TreePosterior(source)
Thompson sampling over the leaf's Normal-Gamma posterior. Given the leaf's pseudo- count n, sample mean m, and sample variance v, draws are mu ~ N(m, exploration * v / max(n, 1)); the posterior on the leaf mean assuming a Normal-Gamma conjugate with weak prior. exploration = 0.0 collapses to the leaf mean.
Constructors
ThompsonTreePosterior
Properties
priorVariance
Prior variance applied when the leaf has effectively no signal.
priorWeight
Pseudo-count added to the leaf's totalWeights to avoid divide-by-zero on empty leaves.
Functions
evaluate
open override fun evaluate(snapshot: TreeRegressionResult, x: VectorView, rng: Random, exploration: Double = 1.0): Double(source)
Score a query point x under the regression snapshot. exploration controls the posterior-variance scale (Thompson) or the UCB width (LinUcb-style); 0.0 collapses to the point estimate.