mab

package
v0.0.0-...-483d5da Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrZeroDisplays = fmt.Errorf("there are no displays for banners")

Functions

This section is empty.

Types

type Mab

type Mab struct {
	Display int // amount of displays banners to the group
	Click   int // amount of clicks on banners
}

func NewMab

func NewMab() *Mab

func (*Mab) GetAmount

func (m *Mab) GetAmount(displays float64, clicks float64, total float64) float64

func (*Mab) MaxClick

func (m *Mab) MaxClick(rotations map[string]float64) float64

func (*Mab) SelectMaxClickedBanners

func (m *Mab) SelectMaxClickedBanners(amounts map[string]float64, maxAmount float64) []string

func (*Mab) SelectOne

func (m *Mab) SelectOne(banners []string) string

func (*Mab) Ucb

func (m *Mab) Ucb(banners []string, clicks map[string]int, displays map[string]int) (string, error)

Ucb represents the upper confidence bound algorithm

func (*Mab) ZeroDisplays

func (m *Mab) ZeroDisplays(banners []string, displays map[string]int) error

Jump to

Keyboard shortcuts

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