Conversation
…all the generated models
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a model comparison feature for regression analysis, refactors model storage to distinguish between generated and selected models, and improves user feedback when models change. The changes implement deterministic model ID generation based on group ID, predictor variables, and model year, replacing the previous random ID approach.
Changes:
- Added a modal popup to display side-by-side comparisons of old vs updated regression models with key statistics
- Introduced
generatedModelsproperty and service methods to store all generated models separately from the selected model - Implemented change detection logic to alert users when selected models are updated with different statistics
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| regression-models.service.ts | Changed model ID generation from random to deterministic (groupId + predictor variables + year) |
| analysis-validation.service.ts | Added optional chaining for safer null handling when checking model validity |
| analysis-db.service.ts | Added BehaviorSubject and service methods to persist generated models per group |
| regression-model-selection.component.ts | Added subscriptions for generated models tracking and router navigation cleanup; updated model selection to use generatedModels array |
| regression-model-selection.component.html | Updated template bindings from group.models to generatedModels |
| regression-model-menu.component.ts | Implemented model comparison logic, modal management, and updated model generation to maintain both generated and selected models |
| regression-model-menu.component.html | Added model comparison modal UI with side-by-side table and alert banner for changed models |
| regression-model-menu.component.css | Added CSS styling for the model comparison modal |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...analysis/regression-model-selection/regression-model-menu/regression-model-menu.component.ts
Show resolved
Hide resolved
...alysis/regression-model-selection/regression-model-menu/regression-model-menu.component.html
Outdated
Show resolved
Hide resolved
...alysis/regression-model-selection/regression-model-menu/regression-model-menu.component.html
Show resolved
Hide resolved
...alysis/regression-model-selection/regression-model-menu/regression-model-menu.component.html
Outdated
Show resolved
Hide resolved
...analysis/regression-model-selection/regression-model-menu/regression-model-menu.component.ts
Show resolved
Hide resolved
...analysis/regression-model-selection/regression-model-menu/regression-model-menu.component.ts
Show resolved
Hide resolved
...n-analysis/group-analysis/regression-model-selection/regression-model-selection.component.ts
Show resolved
Hide resolved
rmroot
requested changes
Jan 14, 2026
Member
rmroot
left a comment
There was a problem hiding this comment.
Looks good. Just one change please.
...alysis/regression-model-selection/regression-model-menu/regression-model-menu.component.html
Outdated
Show resolved
Hide resolved
rmroot
approved these changes
Jan 16, 2026
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.
connects #2163
This pull request introduces a model comparison feature to the regression model selection workflow, refactors how generated models are handled, and improves user feedback when models change. The changes enhance the user experience by allowing users to compare old and new regression models side-by-side and clarify the distinction between generated and selected models.
Key changes include:
Model Comparison Feature
regression-model-menu.component.html,regression-model-menu.component.css,regression-model-menu.component.ts)Refactoring Model Handling
generatedModelsproperty to clearly separate all generated models from the currently selected model(s). Updated all relevant logic and template bindings to usegeneratedModelsinstead ofgroup.models. (regression-model-menu.component.ts,regression-model-menu.component.html,regression-model-selection.component.html)generatedModelsusing the analysis database service and to maintain selection state across regenerations. (regression-model-menu.component.ts)Improved User Feedback
Added an alert to notify users when the selected model has changed, with a link to open the comparison modal. (
regression-model-menu.component.html)Added logic to compare old and new models and set the
changedModelproperty when differences are detected. (regression-model-menu.component.ts)UI and Style Enhancements
regression-model-menu.component.css)Minor Improvements
Updated overlay logic to include the model comparison modal. (
regression-model-menu.component.html)Added necessary imports for routing events (preparation for possible navigation-related logic). (
regression-model-selection.component.ts)