Repository navigation
📈 Algorithm update - #1
Merged
Merged
Conversation
|
Visit the preview URL for this PR (updated for commit 990cfd3): https://dogmatch-33--pr1-algorithm-update-funb46yc.web.app (expires Mon, 20 Apr 2026 10:10:19 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 3be598a5fc061b587f1c015bd81cd7e7b2c794a8 |
There was a problem hiding this comment.
Pull request overview
Updates quiz scoring so per-question importance (1–5) is mapped to geometrically spaced weights, making each step produce a consistent proportional impact on match scoring. Also adjusts GitHub Actions workflow permissions for Firebase Hosting deploys.
Changes:
- Introduced a geometric
IMPORTANCE_WEIGHTStable and helper to transform importance ratings into ratio-scale weights. - Applied the transformed weight in rating, string checkbox, and array checkbox scoring paths.
- Added explicit
permissionsblocks to Firebase Hosting PR/merge workflows.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/app/dog-rating.ts | Replaces linear importance multipliers with geometric weights via a shared helper. |
| .github/workflows/firebase-hosting-pull-request.yml | Adds explicit workflow token permissions for PR previews. |
| .github/workflows/firebase-hosting-merge.yml | Adds explicit workflow token permissions for merges to main. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Fix importance weight scaling to use geometric spacing
Problem
The quiz's per-question importance rating (1-5) was used as a raw linear multiplier on each trait's contribution to the match score. This created wildly inconsistent proportional impact across the scale:
Choosing between 1 and 2 doubled a trait's weight, while choosing between 4 and 5 only increased it by 25%. Users perceive each step as equally meaningful, but the math didn't reflect that.
Solution
Replaced the raw linear multiplier with a geometrically-spaced weight lookup table (
[1.0, 1.5, 2.24, 3.34, 5.0]), where each step is a consistent ~50% proportional increase. This is derived fromr^(importance - 1)withr^4 = 5(preserving the existing 5:1 max/min dynamic range).This approach is grounded in the Weber-Fechner law from psychophysics, which shows that humans perceive proportional changes — not absolute ones — as equal. It's also the recommended practice in multi-criteria decision analysis (MCDA) literature for transforming ordinal importance ratings into ratio-scale weights.
Changes
IMPORTANCE_WEIGHTSlookup table andgetImportanceWeight()helper todog-rating.ts