Repository navigation
adds alpha param to ts configurable - #3422
Conversation
danoswaltCL
commented
Nov 13, 2026
- 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
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
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
bcb37
left a comment
There was a problem hiding this comment.
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?
…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]>
|
@bcb37 addressed what you pointed out and handled a couple merge conflicts from the other similar branch going into dev, ready for re-review |
