parameters: (self)
return_statement: return info
docstring: Estimate and print elo values. This function must be called after add all the sgfs/sgf files
docstring_summary: Estimate and print elo values. This function must be called after add all the sgfs/sgf files
docstring_tokens: Estimate and print elo values . This function must be called after add all the sgfs / sgf files
function: def _estimate_elo(self) -> elo.EloInfo:
      """Estimate and print elo values. This function must be called after add all the sgfs/sgf files"""
      pla_names = set(itertools.chain(*(name_pair for name_pair in self.results.keys())))
      data = []
      for pla_black in pla_names:
        for pla_white in pla_names:
          if (pla_black == pla_white):
            continue
          else:
            if (pla_black, pla_white) not in self.results:
              continue
            record = self.results[(pla_black, pla_white)]
            total = record.win + record.lost + record.draw
            assert total >= 0
            if total == 0:
              continue
  
            win = record.win + 0.5 * record.draw
            winrate = win / total
            data.extend(elo.likelihood_of_games(
              pla_black,
              pla_white,
              total,
              winrate,
              include_first_player_advantage=self._estimate_first_player_advantage
            ))
  
      for pla in pla_names:
        data.extend(elo.make_single_player_prior(pla, self._elo_prior_games,0))
      data.extend(elo.make_center_elos_prior(list(pla_names),0)) # Add this in case user put elo_prior_games = 0
      if self._estimate_first_player_advantage:
        data.extend(elo.make_single_player_prior(elo.P1_ADVANTAGE_NAME, (1.0 + self._elo_prior_games) * 2.0, 0))
  
      info = elo.compute_elos(data, verbose=True)
      return info
function_tokens: def _estimate_elo ( self ) -> elo . EloInfo : pla_names = set ( itertools . chain ( * ( name_pair for name_pair in self . results . keys ( ) ) ) ) data = [ ] for pla_black in pla_names : for pla_white in pla_names : if ( pla_black == pla_white ) : continue else : if ( pla_black , pla_white ) not in self . results : continue record = self . results [ ( pla_black , pla_white ) ] total = record . win + record . lost + record . draw assert total >= 0 if total == 0 : continue win = record . win + 0.5 * record . draw winrate = win / total data . extend ( elo . likelihood_of_games ( pla_black , pla_white , total , winrate , include_first_player_advantage = self . _estimate_first_player_advantage ) ) for pla in pla_names : data . extend ( elo . make_single_player_prior ( pla , self . _elo_prior_games , 0 ) ) data . extend ( elo . make_center_elos_prior ( list ( pla_names ) , 0 ) ) # Add this in case user put elo_prior_games = 0 if self . _estimate_first_player_advantage : data . extend ( elo . make_single_player_prior ( elo . P1_ADVANTAGE_NAME , ( 1.0 + self . _elo_prior_games ) * 2.0 , 0 ) ) info = elo . compute_elos ( data , verbose = True ) return info