feat: weighted question scoring with deterministic tie-breaking - #2
Open
Newstrife wants to merge 1 commit into
Open
feat: weighted question scoring with deterministic tie-breaking#2Newstrife wants to merge 1 commit into
Newstrife wants to merge 1 commit into
Conversation
- Add per-question weights (0.6-1.3) reflecting how strongly each item discriminates its dimension; weights per dimension sum to exactly 8.0, so the score range (8-40) and neutral midpoint (24) are unchanged - Non-uniform weights make an exact tie at the midpoint practically unreachable, removing the silent coin-flip for borderline users - Exact ties (e.g. all-neutral answers) are broken deterministically using the highest-weighted non-neutral answer instead of defaulting to the left pole - determineType/determineQuickType/determineDimensionPreference accept an optional answers param for tie-breaking (backward compatible) - Quick test thresholds and percentages are now derived per dimension from question weights, with percentage clamping to 0-100 - Add tests: tie-breaking (full + quick), weight integrity, clamping
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.
Problem
determineTypeuses a hard> 24threshold. With 8 equally-weighted questions per dimension (score range 8-40, midpoint 24), an exact score of 24 is reachable and silently resolves to the left pole (E/S/F/J) — a coin-flip result for borderline users. The same issue exists indetermineQuickType(threshold 6) anddetermineDimensionPreference(threshold 24).Solution
breakTieexamines the dimension's questions from highest to lowest weight and uses the first non-neutral answer, instead of silently defaulting to the left pole.determineType/determineQuickType/determineDimensionPreferenceaccept an optionalanswersparam to enable tie-breaking — fully backward compatible;generateResult/generateQuickResult/generateDimensionResultpass it automatically.questionWeights,getQuestionWeight,dimensionWeightSums.Tests
175 tests pass, including new coverage for:
Notes