MultiElo

package module
v0.0.0-...-484f5cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 5 Imported by: 0

README

go-multielo

A reimplementation of the python Multielo in Go project which can be found here: https://github.com/djcunningham0/multielo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(base float32) func(int) []float32

func DiagonalFill

func DiagonalFill[T constraints.Ordered](list [][]T, f func(T) T) [][]T

func Exponential

func Exponential(n int, base float32) []float32

func JoinProject

func JoinProject[T, P, R any, S comparable](
	left []T,
	right []P,
	leftSelector func(T) S,
	rightSelector func(P) S,
	projection func(Tuple[T, []P]) R) (results []R)

func Liner

func Liner(n int) (scores []float32)

func Range

func Range(start int, end int) (result []int)

func Sum

func Sum[T any, R constraints.Ordered](list []T, selector func(T) R) (sum R)

Types

type Elo

type Elo struct {
	K, D, Base, Log float32
	Scoring         func(int) []float32
}

func (*Elo) CalculateActualScores

func (s *Elo) CalculateActualScores(n int, positions []int) []float32

func (*Elo) CalculateExpectedScores

func (s *Elo) CalculateExpectedScores(ratings []float32) []float32

func (*Elo) CalculateRating

func (s *Elo) CalculateRating(ratings []float32, positions []int) []float32

type Tuple

type Tuple[L, R any] struct {
	Left  L
	Right R
}

func Join

func Join[T, P any, S comparable](
	left []T,
	right []P,
	leftSelector func(T) S,
	rightSelector func(P) S) []Tuple[T, []P]

func Zip

func Zip[L any, R any](left []L, right []R) []Tuple[L, R]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL