On this page:
6.1 Types and Predicates
result-matrix?
6.2 Construction
make-result-matrix
6.3 Recording Results
record-result
result-value
result-matrix-formatted

6 Module rml/results

 (require rml/results) package: rml-core

This packages implements a results matrix, sometimes referred to as a confusion matrix to record the outcome of classification operations. Specifically the matrix uses all distinct classification values (ω) as both rows and columns and maps the predicted values to the labeled values incrementing the integer value at the intersection for each operation.

Examples:
> (define results (make-result-matrix dataset))
> (for-each displayln (result-matrix-formatted results))

(true ω pred      Iris-versicolor  Iris-setosa      Iris-virginica  )

(Iris-versicolor                0                0                0 )

(Iris-setosa                    0                0                0 )

(Iris-virginica                 0                0                0 )

6.1 Types and Predicates

predicate

(result-matrix? a)  boolean?

  a : any/c
Returns #f if the value of a is a result-matrix.

6.2 Construction

constructor

(make-result-matrix dataset)  result-matrix?

  dataset : data-set?
Create a new result-matrix using the values provided by (classifier-product dataset) as row and column indices.

6.3 Recording Results

procedure

(record-result C true-ω predicted-ω)  result-matrix?

  C : result-matrix?
  true-ω : any/c
  predicted-ω : any/c
Increment the result count for in the result-matrix for the combination of predicted and true/known classifiers.

procedure

(result-value C true-ω predicted-ω)  integer?

  C : result-matrix?
  true-ω : any/c
  predicted-ω : any/c
Return the current result count in result-matrix for the combination of predicted and true/known classifiers.

accessor

(result-matrix-formatted)  result-matrix?

Return a formatted version of the result matrix with label data suitable for display or printing.