Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Model ¶
Model takes in a dataset of Pairs that describe the winner and loser of multiple match-ups. The model will return a map[string]float64 that contains the preference/relevance of each given element.
Example ¶
rand.Seed(10) var data = []Pair{ {Winner: "Player 2", Loser: "Player 1"}, {Winner: "Player 2", Loser: "Player 3"}, {Winner: "Player 3", Loser: "Player 2"}, {Winner: "Player 3", Loser: "Player 2"}, } output := Model(data) fmt.Printf("Player 1: %.2f\n", output["Player 1"]) fmt.Printf("Player 2: %.2f\n", output["Player 2"]) fmt.Printf("Player 3: %.2f\n", output["Player 3"])
Output: Player 1: 0.00 Player 2: 0.33 Player 3: 0.67
Types ¶
Click to show internal directories.
Click to hide internal directories.