The new user interface is in preview!

Want to check it out? Click here! (If you don't like it, you can still switch back)

The draft is underway!

Click here to go to your war room, or visit the war room item in the draft menu.

League Forums

Main - Suggestion Box

Fix Power Rankings

By isenru
2/20/2016 10:08 pm
For some reason, the power rankings in our league (MFN-31) seem really off. For example, my team Minnesota (3-4) is ranked 29, even though there are 3 0-7 teams and 3 1-6 teams. The metrics could be balanced better, because there should be no way an 0-7 team is ranked higher than a 3-4 team, and yet all 3 0-7 teams are higher.

Re: Fix Power Rankings

By punisher
2/21/2016 10:34 pm
isenru wrote:
For some reason, the power rankings in our league (MFN-31) seem really off. For example, my team Minnesota (3-4) is ranked 29, even though there are 3 0-7 teams and 3 1-6 teams. The metrics could be balanced better, because there should be no way an 0-7 team is ranked higher than a 3-4 team, and yet all 3 0-7 teams are higher.


this thread should explain the power rankings = http://mfn20.myfootballnow.com/community/3/1320?page=1

if that thread is right then really there isn't a problems with the power rankings.

Re: Fix Power Rankings

By Mr.Krazy
2/22/2016 11:19 am
Power rankings are definitely off a little bit but I don't see it as a major priority to fix just yet.

In CUST-10, my 3-5 team is ranked 10th in power rankings so it is for sure off

Re: Fix Power Rankings. ( a really good code)

By blackflys
2/26/2016 12:10 am
I don't know much about making this all fit together but hopefully someone does. This is supposobly a really good code that took a lot of studying and brainy type of patience. Anyways if you need more info let me know...


<?php

$dataYear = "data" . $_GET['year'] . ".php";

include $dataYear;

if (count($season) < 1 || count($ranks) < 1) { echo "No Data"; exit; }


function getError(array $ranking, array $week) {
$error = 0;
foreach ($week as $game) {
$loser = $game[2];
$winner = $game[0];
$loseRank = $ranking[$loser];
$winRank = $ranking[$winner];
$margin = $game[3] - $game[4];
# echo("#$winRank $winner $game[3] $game[1] #$loseRank $loser $game[4] <br/>");
if ($margin > 0 && $winRank < $loseRank) continue;
$error += ($winRank - $loseRank) + ($margin / 7);
if ($game[1] == '@') $error += 1;
}
# echo ("error = $error<br/>");
return $error;

}

function doMaxError($thiserror, $rank, $week, $maxerror) {
if ($maxerror[4][0] > $thiserror) return $maxerror;
if ($maxerror[3][0] > $thiserror) {
$maxerror[4][0] = $thiserror; $maxerror[4][1] = $rank; $maxerror[4][2] = $week;
return $maxerror;
}
if ($maxerror[2][0] > $thiserror) {
$maxerror[4][0] = $maxerror[3][0]; $maxerror[4][1] = $maxerror[3][1]; $maxerror[4][2] = $maxerror[3][2];
$maxerror[3][0] = $thiserror; $maxerror[3][1] = $rank; $maxerror[3][2] = $week;
return $maxerror;
}
if ($maxerror[1][0] > $thiserror) {
$maxerror[4][0] = $maxerror[3][0]; $maxerror[4][1] = $maxerror[3][1]; $maxerror[4][2] = $maxerror[3][2];
$maxerror[3][0] = $maxerror[2][0]; $maxerror[3][1] = $maxerror[2][1]; $maxerror[3][2] = $maxerror[2][2];
$maxerror[2][0] = $thiserror; $maxerror[2][1] = $rank; $maxerror[2][2] = $week;
return $maxerror;
}
if ($maxerror[0][0] > $thiserror) {
$maxerror[4][0] = $maxerror[3][0]; $maxerror[4][1] = $maxerror[3][1]; $maxerror[4][2] = $maxerror[3][2];
$maxerror[3][0] = $maxerror[2][0]; $maxerror[3][1] = $maxerror[2][1]; $maxerror[3][2] = $maxerror[2][2];
$maxerror[2][0] = $maxerror[1][0]; $maxerror[2][1] = $maxerror[1][1]; $maxerror[2][2] = $maxerror[1][2];
$maxerror[1][0] = $thiserror; $maxerror[1][1] = $rank; $maxerror[1][2] = $week;
return $maxerror;
}
$maxerror[4][0] = $maxerror[3][0]; $maxerror[4][1] = $maxerror[3][1]; $maxerror[4][2] = $maxerror[3][2];
$maxerror[3][0] = $maxerror[2][0]; $maxerror[3][1] = $maxerror[2][1]; $maxerror[3][2] = $maxerror[2][2];
$maxerror[2][0] = $maxerror[1][0]; $maxerror[2][1] = $maxerror[1][1]; $maxerror[2][2] = $maxerror[1][2];
$maxerror[1][0] = $maxerror[0][0]; $maxerror[1][1] = $maxerror[0][1]; $maxerror[1][2] = $maxerror[0][2];
$maxerror[0][0] = $thiserror; $maxerror[0][1] = $rank; $maxerror[0][2] = $week;
return $maxerror;
}


$maxerror = array(array("0","",""),array("0","",""),array("0","",""),array("0","",""),array("0","",""));
foreach ($ranks as $rank) {
$error = 0;
for ($week =4; $week < 19; $week++) {
$thiserror = 0;
$mult = 40;
$totalmult = 50;
for($j = $week; $j < 19 && $j < $week + 8; $j++) {
$thiserror += $mult * getError($rank[$week], $season[$j]);
$mult = $mult / 1.5;
}
$thiserror = $thiserror / $totalmult;
$error += $thiserror;
$maxerror = doMaxError($thiserror,$rank[0],$week, $maxerror);
}
$error = $error / 15;
$results[$rank[0]] = $error;
}

asort($results);
echo "Rank | error per week<br/>";
foreach ($results as $key => $val) {
echo "$key | $val<br/>";
}
echo "<br/><br/><br/> Max error =<br/>";
foreach ($maxerror as $maxer) {print "$maxer[0], $maxer[1], week $maxer[2]<br/>";}
?>

Re: Fix Power Rankings

By Morbid
2/27/2016 4:05 pm
You lost me at <?php

Re: Fix Power Rankings

By TAFIV
2/27/2016 4:24 pm
it's programming code, doesn't help any since JD can't legally use it without permission of whoever wrote it though since there may be copyright issues if he did (no way to know if the code is part of a copyrighted program without contacting the programmer)