Fix recency-weighting variable swap in compute_mastery#637
Open
smz202000 wants to merge 1 commit into
Open
Conversation
The zip(recent, weights) call produces (correctness, weight) pairs, but the loop unpacked them as 'for w, c', assigning correctness to w and weight to c. Since weights are always truthy (positive floats), the expression (1.0 if c else 0.0) always evaluated to 1.0, making the numerator a plain correct-count. Recency weights only influenced the denominator, so mastery became order-independent. Fix: swap the unpacking order to 'for c, w' so that c receives the correctness bool and w the recency weight. Now w * (1.0 if c else 0.0) correctly applies the recency weight to each correctness indicator, making recovering ([F,T,T] = 0.6964) score higher than declining ([T,T,F] = 0.6429). Closes HKUDS#618
|
Im so green to github i dont know ow where to find out where my url for public access is. |
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.
Fixes #618. Zip(recent, weights) produces (correctness, weight) pairs, but the generator unpacked them as (w, c), assigning correctness to w and weight to c. Since weights are always truthy, the numerator was always a plain correct-count, disabling recency weighting. Fix: swap unpacking to (c, w).