Skip to content

adds alpha param to ts configurable - #3422

Open
danoswaltCL wants to merge 2 commits into
devfrom
wip/ts-sampling-alpha-param
Open

danoswaltCL wants to merge 2 commits into
devfrom
wip/ts-sampling-alpha-param

Conversation

@danoswaltCL

Copy link
Copy Markdown
Collaborator
  • adds alpha param to ts configurable
  • db migration for the config table
  • adds scaling calculation and tooltips to feedback area
image (12) image (13) image (14)

…e, adds scaling calculation and tooltips to feedback area
@danoswaltCL
danoswaltCL requested review from bcb37 and zackcl and a balanced review from Copilot November 13, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Configuration edits can write null to a non-nullable scaling-factor column and leave the feedback card displaying stale posteriors and estimated weights.

2 open issues
What changed in this PR

Adds a configurable scaling factor (α) to UpGrade’s native Thompson Sampling implementation. It adjusts the influence of reward counts without changing priors, while keeping configuration and feedback displays aligned with the calculation.

Changes:

  • Persists α with a default of 1 and applies it to assignment and reward-summary posteriors.
  • Adds form validation, overview values, scaled counts, and explanatory tooltips.
  • Extends shared types, unit tests, and implementation documentation.
File Description
interfaces.ts Adds scaling factor and posterior response fields.
en.json Adds labels, validation messages, and formula tooltips.
common-form-helpers.service.ts Adds decimal-place validation.
ts-configurable-reward-count-table.component.ts Formats scaled counts and posterior values.
ts-configurable-reward-count-table.component.scss Adjusts count spacing and wrapping.
ts-configurable-reward-count-table.component.html Displays scaled counts, posteriors, and tooltips.
experiment-reward-feedback-section-card.component.html Displays α and passes it to the table.
ts-configurable-policy-parameters-form.component.ts Adds the scaling-factor form control.
ts-configurable-policy-parameters-form.component.html Adds the input and validation messages.
thompson-sampling-helper.service.ts Handles defaults, validation, configuration, and overview formatting.
thompson-sampling-helper.service.spec.ts Tests scaling-factor helpers and validation.
experiments.selectors.ts Includes α in fallback reward summaries.
experiments.selector.spec.ts Updates summary expectations.
experiments.reducer.spec.ts Updates reward-summary fixtures.
experiments.model.ts Extends configuration types and overview labels.
experiments.effects.spec.ts Updates the reward-fetch fixture.
ThompsonSamplingService.test.ts Tests scaled sampling and unchanged priors.
ThompsonSamplingExperimentCrudService.test.ts Tests persistence, defaults, and scaled summaries.
ExperimentAssignmentService.test.ts Tests passing α to the algorithm.
ExperimentDTO.test.ts Tests scaling-factor input constraints.
1794510446000-thompsonSamplingScalingFactor.ts Adds the database column with default 1.
ThompsonSamplingService.ts Applies α to reward counts in posterior calculations.
ThompsonSamplingExperimentCrudService.ts Persists α and returns scaled posterior summaries.
ExperimentAssignmentService.ts Passes configured α into sampling.
ThompsonSamplingExperimentConfig.ts Defines the scaling-factor entity column.
ExperimentDTO.ts Adds numeric bounds and precision validation.
CLAUDE.md Documents scaling semantics and UI behavior.

Review effort: Balanced

})),
warmupThreshold: experiment.thompsonSamplingConfig?.warmupThreshold ?? 0,
batchSize: experiment.thompsonSamplingConfig?.batchSize ?? 1,
scalingFactor: experiment.thompsonSamplingConfig?.scalingFactor ?? 1,
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants