Skip to content

adds alpha param to ts configurable - #3422

Merged
danoswaltCL merged 4 commits into
devfrom
wip/ts-sampling-alpha-param
Nov 18, 2026
Merged

danoswaltCL merged 4 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

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

@bcb37 bcb37 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When you have the data tab selected, and you edit the ts parameters, the parameter value updates are reflected in the details overview, but not in the rewards data section. Should we update the parameter values and recalculate when we're on the data tab and ts parameters are changed?

danoswaltCL and others added 2 commits November 17, 2026 15:59
…param

Conflicts with dev's rewards-table touchups (#3416) in the reward
feedback card, reward count table component and en.json, resolved to
keep both sides: dev's Received column, total-reward-count row,
estimated-weight formatting and hidden (not grayed) inactive rows, plus
this branch's scaling factor (α) row and scaled counts/posteriors. The
card lists α first and pending rewards last.

The warmup row's visibility goes back to isWarmupConfigured
(warmupThreshold > 0) instead of dev's warmupThreshold > 1, since the
backend treats a threshold of 1 as an active warmup.

CLAUDE.md: update the reward summary endpoint note for the merged
payload, and the obsolete "must stay the newest migration" note.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@danoswaltCL

Copy link
Copy Markdown
Collaborator Author

@bcb37 addressed what you pointed out and handled a couple merge conflicts from the other similar branch going into dev, ready for re-review

@bcb37
bcb37 self-requested a review November 18, 2026 20:41
@danoswaltCL
danoswaltCL merged commit 4b77fc7 into dev Nov 18, 2026
6 checks passed
@danoswaltCL
danoswaltCL deleted the wip/ts-sampling-alpha-param branch November 18, 2026 23:02
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.

3 participants