Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12897

The calculation of correlated tags seems imperfect under small correlations...

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0
    • 1.9, 2.0
    • Tags
    • None
    • Any
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • MOODLE_20_STABLE

      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

            scyrma Mathieu Petit-Clair
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.