Documentation ¶
Index ¶
- 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(fname core.Filename)
- func (cm *Matrix) Probs()
- func (cm *Matrix) Reset()
- func (cm *Matrix) SaveCSV(fname core.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 ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix struct { // normalized probability of confusion: Row = ground truth class, Col = actual response for that class. Prob tensor.Float64 `display:"no-inline"` // incremental sums Sum tensor.Float64 `display:"no-inline"` // counts per ground truth (rows) N tensor.Float64 `display:"no-inline"` // visualization using SimMat Vis simat.SimMat `display:"no-inline"` // true pos/neg, false pos/neg for each class, generated from the confusion matrix TFPN tensor.Float64 `display:"no-inline"` // precision, recall and F1 score by class ClassScores tensor.Float64 `display:"no-inline"` // micro F1, macro F1 and weighted F1 scores for entire matrix ignoring class MatrixScores tensor.Float64 `display:"no-inline"` }
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 ¶
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 ¶
func (*Matrix) ScoreMatrix ¶
func (cm *Matrix) ScoreMatrix()
Click to show internal directories.
Click to hide internal directories.