I've been playing with user tags a bit in a medium server and, being the FIRST user there to introduce my tags I've seen something in the automatic correlation that could be improved.
After introducing my tags (10), all them have been correlated, and really they aren't at all. Looking at code, in the cache_correlated_tags() function, it seems that the $cutoff is calculated this way:
$cutoff = $tag_correlations[$tag_id]->nr * $min_correlation;
(with $min_correlation = 0.25)
That means that, when ONE user (the first) has introduced the tags A & B, the correlation will be:
$cutoff = 1 * 0.25 = 0.25
and in the next line of code:
if($correlation->nr >= $cutoff...
is ALWAYS true! because $correlation->nr is ALWAYS bigger or equal to $cutoff (because $cutoff has been calculated by multiplying by 0.25).
Summarizing:
1) The $min_correlation use seems to be buggy. It causes small $cutoffs always.
2) I would supress the $cutoff calculation and usage completely.
3) Instead I'll redefine $min_correlation like a integer number of correlations (say, at least, 2, or configurable in admin settings).
4) Any COUNT over that integer $min_correlation will be considered as related.
Or, alternatively:
1) Simply force $cutoff calclation to be at least "1" to avoid individual pairs to become correlations.
Just that. Ciao
- will be (partly) resolved by
-
MDL-13124 Notice in tag cron indicates some kind of logic bug
-
- Closed
-