Source code for pyrelational.strategies.regression.thompson_sampling_strategy

"""Thomas Sampling Strategy for Regression."""

from pyrelational.batch_mode_samplers import TopKSampler
from pyrelational.informativeness import ThompsonSampling
from pyrelational.strategies.regression.regression_strategy import RegressionStrategy


[docs] class ThompsonSamplingStrategy(RegressionStrategy): """Implements Thompson Sampling Strategy. Unlabelled samples are scored and queried based on the thompson sampling scorer. """ def __init__(self, axis: int = 0): """Initialize the strategy with the thompson sampling scorer and a deterministic scorer for regression.""" super().__init__(ThompsonSampling(axis=axis), TopKSampler())