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.