Skip to content

Fix recency-weighting variable swap in compute_mastery#637

Open
smz202000 wants to merge 1 commit into
HKUDS:mainfrom
smz202000:fix/618-recency-weighting-unpack
Open

Fix recency-weighting variable swap in compute_mastery#637
smz202000 wants to merge 1 commit into
HKUDS:mainfrom
smz202000:fix/618-recency-weighting-unpack

Conversation

@smz202000

Copy link
Copy Markdown

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).

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
@paslaycorp

Copy link
Copy Markdown

Im so green to github i dont know ow where to find out where my url for public access is.
Is this in reference to my code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compute_mastery recency weighting is disabled by a variable-swap in the zip unpack

2 participants