Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just off the top of my head, what if you compare the % occurrence vs the % if all items had equal number of occurences</p> <p>In your example above<br> John, John, Jon, Jonny<br> 50% John<br> 25% Jon<br> 25% Jonny<br> 33.3% Normal? (I'm making up a word because I don't know what to call this. 3 items: 100%/3)<br> John's score = 50% - 33.3% = 16.7% </p> <p>John, John, Jon, Jon<br> 50% John<br> 50% Jon<br> 50% Normal (2 items, 100%/2)<br> John's score = 50% - 50% = 0% </p> <p>If you had [John, John, John, Jon, Jon] then John's score would be 60%-50% = 10% which is lower than the first case, but higher than the 2nd (hopefully that's the desired result, otherwise you'll need to clarify more what the desired results should be)</p> <p>In your first case [John, John, John, John, Jon] you'd get 80%-50% = 30%<br> For [John, John, John, John, Jon, Jonny] you'd get 66.6%-33.3% = 33.3%<br> That may or may not be what you want.</p> <p>Where the above might factor in more is if you had John*97+Jon+Jonny+Johnny, that would give you 97%-25% = 72%, but John*99+Jon would only give you a score of 99-50% = 49%</p> <p>You'd need to figure out how you want to handle the degenerate case of them all being the same, otherwise you'd get a score of 0% for that which is probably not what you want.</p> <p><strong>EDIT</strong> (okay I made lots of edits, but this one isn't just more examples :p)<br> To normalize the results, take the score as calculated above divide by the limit of max possible score given the number of different values. (Okay, that sounds way more complicated than it needs to, example time)</p> <p>Example:<br> [John, John, Jon, Jonny] 50% - 33.3% = 16.7%. That's the previous score, but with 3 items the upper limit of your score would be 100%-33.3% = 66.6%, so if we take that into account, we have 16.7/66.6 = 25%</p> <p>[John, John, Jon, Jon] gives (50-50) /50 = 0%<br> [John, John, John, Jon, Jon] gives (60-50) /50 = 20%<br> [John, John, John, John, Jon] gives (80-50)/50 = 60%<br> [John, John, John, John, Jon, Jonny] gives (66.6-33.3)/(66.6)= 50%<br> [John*97, Jon, Jonny, Johnny] gives (97-25)/75 = 96%<br> [John*99, Jon] gives (99-50)/50 = 98% </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload