Documentation ¶
Index ¶
- Variables
- type Matrix
- func (cm *Matrix) Incr(class, resp int)
- func (cm *Matrix) Init(n int)
- func (cm *Matrix) InitFromLabels(lbls []string, fontSize int)
- func (cm *Matrix) OpenCSV(filename gi.FileName)
- func (cm *Matrix) Probs()
- func (cm *Matrix) Reset()
- func (cm *Matrix) SaveCSV(filename gi.FileName)
- func (cm *Matrix) ScoreClass(class int)
- func (cm *Matrix) ScoreMatrix()
- func (cm *Matrix) SetLabels(lbls []string)
- func (cm *Matrix) SumTFPN(class int)
Constants ¶
This section is empty.
Variables ¶
View Source
var KiT_Matrix = kit.Types.AddType(&Matrix{}, MatrixProps)
View Source
var MatrixProps = ki.Props{ "ToolBar": ki.PropSlice{ {"SaveCSV", ki.Props{ "label": "Save CSV...", "icon": "file-save", "desc": "Save CSV-formatted confusion probabilities (Probs)", "Args": ki.PropSlice{ {"CSV File Name", ki.Props{ "ext": ".csv", }}, }, }}, {"OpenCSV", ki.Props{ "label": "Open CSV...", "icon": "file-open", "desc": "Open CSV-formatted confusion probabilities (Probs)", "Args": ki.PropSlice{ {"Weights File Name", ki.Props{ "ext": ".csv", }}, }, }}, }, }
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix struct { // [view: no-inline] normalized probability of confusion: Row = ground truth class, Col = actual response for that class. Prob etensor.Float64 `view:"no-inline" desc:"normalized probability of confusion: Row = ground truth class, Col = actual response for that class."` // [view: no-inline] incremental sums Sum etensor.Float64 `view:"no-inline" desc:"incremental sums"` // [view: no-inline] counts per ground truth (rows) N etensor.Float64 `view:"no-inline" desc:"counts per ground truth (rows)"` // [view: no-inline] visualization using SimMat Vis simat.SimMat `view:"no-inline" desc:"visualization using SimMat"` // [view: no-inline] true pos/neg, false pos/neg for each class, generated from the confusion matrix TFPN etensor.Float64 `view:"no-inline" desc:"true pos/neg, false pos/neg for each class, generated from the confusion matrix"` // [view: no-inline] precision, recall and F1 score by class ClassScores etensor.Float64 `view:"no-inline" desc:"precision, recall and F1 score by class"` // [view: no-inline] micro F1, macro F1 and weighted F1 scores for entire matrix ignoring class MatrixScores etensor.Float64 `view:"no-inline" desc:"micro F1, macro F1 and weighted F1 scores for entire matrix ignoring class"` }
Matrix computes the confusion matrix, with rows representing the ground truth correct class, and columns representing the actual answer produced. Correct answers are along the diagonal.
func (*Matrix) Init ¶
Init initializes the Matrix for given number of classes, and resets the data to zero.
func (*Matrix) InitFromLabels ¶ added in v1.1.57
InitFromLabels does initialization based on given labels. Calls Init on len(lbls) and SetLabels. Default fontSize = 12 if 0 or -1 passed
func (*Matrix) Probs ¶
func (cm *Matrix) Probs()
Probs computes the probabilities based on accumulated data
func (*Matrix) ScoreClass ¶ added in v1.3.0
func (*Matrix) ScoreMatrix ¶ added in v1.3.0
func (cm *Matrix) ScoreMatrix()
Click to show internal directories.
Click to hide internal directories.