Metrics
Model evaluation metrics for classification tasks
Operations
Accuracy
Calculates accuracy: (TP + TN) / Total
function : native : Accuracy(predictions:Bool[], actuals:Bool[]) ~ FloatParameters
| Name | Type | Description |
|---|---|---|
| predictions | Bool | predicted boolean values |
| actuals | Bool | actual boolean values |
Return
| Type | Description |
|---|---|
| Float | accuracy score between 0.0 and 1.0 |
ConfusionMatrix
Creates a confusion matrix
function : native : ConfusionMatrix(predictions:Bool[], actuals:Bool[]) ~ Int[,]Parameters
| Name | Type | Description |
|---|---|---|
| predictions | Bool | predicted boolean values |
| actuals | Bool | actual boolean values |
Return
| Type | Description |
|---|---|
| Int | 2x2 confusion matrix [[TN, FP], [FN, TP]] |
F1Score
Calculates F1 score: 2 * (Precision * Recall) / (Precision + Recall)
function : native : F1Score(predictions:Bool[], actuals:Bool[]) ~ FloatParameters
| Name | Type | Description |
|---|---|---|
| predictions | Bool | predicted boolean values |
| actuals | Bool | actual boolean values |
Return
| Type | Description |
|---|---|
| Float | F1 score between 0.0 and 1.0 |
MCC
Calculates Matthews Correlation Coefficient (MCC)
function : native : MCC(predictions:Bool[], actuals:Bool[]) ~ FloatParameters
| Name | Type | Description |
|---|---|---|
| predictions | Bool | predicted boolean values |
| actuals | Bool | actual boolean values |
Return
| Type | Description |
|---|---|
| Float | MCC score between -1.0 and 1.0 |
Precision
Calculates precision: TP / (TP + FP)
function : native : Precision(predictions:Bool[], actuals:Bool[]) ~ FloatParameters
| Name | Type | Description |
|---|---|---|
| predictions | Bool | predicted boolean values |
| actuals | Bool | actual boolean values |
Return
| Type | Description |
|---|---|
| Float | precision score between 0.0 and 1.0 |
PrintConfusionMatrix
Prints a formatted confusion matrix
function : native : PrintConfusionMatrix(matrix:Int[,]) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| matrix | Int | 2x2 confusion matrix |