benchmark

package
v0.0.0-...-57178c3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: ISC Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Db             *gorm.DB
	System         *models.Benchmark // bluwhaze reference benchmarks
	Accounts       *models.Benchmark // user mapped benchmarks
	AccountQuality *models.AccountQuality
}

Context wraps the database connection and other useful resources

func (*Context) GetAccountQuality

func (ctx *Context) GetAccountQuality(acc *models.Account, window int) (float64, error)

GetAccountQuality gets the feedback quality for a user requires that ctx.System is initialized

func (*Context) GetRecordingLabels

func (ctx *Context) GetRecordingLabels(recID string, opener int, closer int, threshold float64, rb *models.RecordingLabelsTree) (sort.StringSlice, error)

GetRecordingLabels gets the corrected labels for a given recording ID and time window

Assumes ctx.AccountQuality is set.

func (*Context) Init

func (ctx *Context) Init() error

Init initializes the context required for many benchmark actions with data from the database

func (*Context) UpdateAccountQualities

func (ctx *Context) UpdateAccountQualities(window int) error

UpdateAccountQualities sets all accounts feedback

func (*Context) WriteCSV

func (ctx *Context) WriteCSV(threshold float64, output string, window int) error

WriteCSV writes labels to a CSV for training purposes

User labels are merged based on individual user quality and only used if the resultant quality exceeds the provided threshold

type RollingMCC

type RollingMCC struct {
	Tp      float64
	Fp      float64
	Tn      float64
	Fn      float64
	Length  int
	MCC     float64
	MeanMCC float64
}

RollingMCC represents a rolling calculation of Matthews correlation coefficients

func (*RollingMCC) Calculate

func (rmcc *RollingMCC) Calculate(corpus []string, actual internal.Set, predicted internal.Set) float64

Calculate returns the Matthews correlation coefficient a rolling mean is calculated by storing the number of items that make up the calculation

Jump to

Keyboard shortcuts

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