Core machine learning types: the seedable Random generator, Matrix2D linear algebra and activations, matrix reference holders, the NeuralNetwork and CSV-backed MatrixReader. Compile with -lib ml.
ThresholdResult
What a threshold actually did: the four confusion counts and the rates read off them. A separate type rather than a bare array because these numbers are only meaningful together. Recall without the false-positive rate says nothing about cost, and a rate without the count behind it hides how few instances it rests on -- a recall of 1.0 over two positives is not the same claim as a recall of 1.0 over two thousand.
Operations
GetAccuracy #
Correct decisions over all decisions. Included for completeness and deliberately not the number to report when one class dominates: predicting the majority for everything scores well here while detecting nothing.
method : public : GetAccuracy() ~ FloatReturn
| Type | Description |
|---|---|
| Float | the accuracy, or 0.0 for an empty sample |
GetFpr #
Real negatives wrongly flagged, over all real negatives. The number to compare against an intended budget. A threshold picked to hold a budget on one sample has no obligation to hold it on another, and this is how far it drifted.
method : public : GetFpr() ~ FloatReturn
| Type | Description |
|---|---|
| Float | the false-positive rate, or 0.0 when there are no real negatives |
GetPrecision #
Alerts that were real, over all alerts raised. Measured on this sample, so it carries this sample's class balance. When the deployment balance differs -- and for rare events it usually does -- the precision an operator would see is different, and follows from the recall and false-positive rate rather than from this number.
method : public : GetPrecision() ~ FloatReturn
| Type | Description |
|---|---|
| Float | the precision, or 0.0 when nothing was flagged |