Soccer Elo Ratings
1.0.0
這是專門調整足球比賽的ELO評級計算器。
它可以根據分佈在不同賽季/聯賽中的比賽歷史來計算給定的團隊評分,為您提供團隊A Beating Team B的可能性,導入和導出數據可以做JSON文件,個性化算法以及更多功能。
來自Wikipedia:
ELO評級系統是一種計算競爭對手 - 競爭者遊戲(例如國際象棋)中玩家的相對技能水平的方法。它以其匈牙利出生的美國物理教授的創作者Arpad Elo的名字命名。
該實現需要進行一些調整以適應足球比賽,更值得注意的是,添加一個變量,該變量根據目標差異在給定匹配中擴散的變量。
有關公式和更多理論的詳細信息,請訪問Wikipedia頁面。
初始評級值為1500點,而默認k為20點(但很容易變化)。
此外,每個賽季之後,您可以通過設置RefressTomean變量來將所有團隊的積分恢復為平均值。這在競爭性聯賽中特別有用,在每個新賽季開始時有很多轉會和新球員(默認是正確的)。
更高的排名團隊仍將獲得優勢,但它會更具競爭力。
EloCalculator calculator = new EloCalculator ();
try {
calculator = new EloCalculator . Builder ()
. setK ( 20 )
. setLeagues ( "C: \ Soccer \ Data.json" )
. setRegressTowardMean ( true )
. build ();
} catch ( IOException ex ) {
Logger . getLogger ( MainClass . class . getName ()). log ( Level . SEVERE , null , ex );
} calculator . calculateRatings ();您可以保存它(以後加載,因此您無需重新計算)。
try {
calculator . saveTeamsJSONFile ( "C: \ Soccer \ Ratings_Jan_2017.json" );
} catch ( IOException ex ) {
Logger . getLogger ( MainClass . class . getName ()). log ( Level . SEVERE , null , ex );
}或者您可以直接獲取數據。在此示例中,我們僅按降序打印評級。
System . out . println ( "Ranking: " );
List < Team > teams = calculator . getTeams ( true );
for ( Team t : teams )
System . out . println ((( int ) t . getLastRating (). getRating ()) + " " + t . getName ()); [
{
"champion" : " Palmeiras " ,
"name" : " Campeonato Brasileiro 2016 " ,
"matches" : [
{
"home" : " Vitória " ,
"away" : " Palmeiras " ,
"homeGoals" : 1 ,
"awayGoals" : 2 ,
"date" : " Dec 11, 2016 12:00:00 AM "
},
{
"home" : " Palmeiras " ,
"away" : " Atlético-PR " ,
"homeGoals" : 4 ,
"awayGoals" : 0 ,
"date" : " May 14, 2016 12:00:00 AM "
}
],
"year" : 2016
}
]我將來有幾件事...
The MIT License (MIT)
Copyright (c) 2016 Victor Santiago
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.