Repository navigation
adds alpha param to ts configurable - #3422
Open
danoswaltCL wants to merge 2 commits into
Open
danoswaltCL wants to merge 2 commits into
danoswaltCL wants to merge 2 commits into
Conversation
danoswaltCL
commented
Nov 13, 2026
Collaborator
- adds alpha param to ts configurable
- db migration for the config table
- adds scaling calculation and tooltips to feedback area
…e, adds scaling calculation and tooltips to feedback area
danoswaltCL
requested review from
bcb37 and
zackcl
and
a balanced review from Copilot
November 13, 2026 14:45
Contributor
There was a problem hiding this comment.
🟡 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
