confu

package
v0.0.0-...-bc599d9 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSimpleNameMap

func MakeSimpleNameMap(labels []int) map[int]string

Builds a basic dictionary where each label is simply given its numerical value as a name. Can be used if you don't have string names for your labels.

func ReadNameMap

func ReadNameMap(filename string, separator ...string) (map[int]string, error)

Reads a map for the names of each label. The names file must have one entry per line. In that entry, there must be 2 fields separated by separator (a space by default) the first one is the number of the label, the second one, its name.

Types

type Confusions

type Confusions struct {
	Actual    []int
	Predicted []int
	Labels    []int
	// contains filtered or unexported fields
}

func MCConfusions

func MCConfusions(M *boo.MultiClass, D *utils.DataBunch) *Confusions

func (*Confusions) Matrix

func (C *Confusions) Matrix() [][]int

func (*Confusions) PrintTopN

func (C *Confusions) PrintTopN(N int, m map[int]string) string

func (*Confusions) TopNForLabelM

func (C *Confusions) TopNForLabelM(N, M int, docopy ...bool) ([]int, []int)

Returns the a []int with the M labels most commonly predicted by the model when the actual label is M. If M is not a valid label in the dataset, returns nil. It also returns the fraction of instances where label M is predicted to be each of the labels.

func (*Confusions) TopNPerLabel

func (C *Confusions) TopNPerLabel(N int) ([][]int, [][]int)

For each label, returns the

Jump to

Keyboard shortcuts

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