Learn R Programming

fdm2id (version 0.9.6)

confusion: Confuion matrix

Description

Plot a confusion matrix.

Usage

confusion(predictions, gt, norm = TRUE, graph = TRUE)

Value

The confusion matrix.

Arguments

predictions

The prediction.

gt

The ground truth.

norm

Whether or not the confusion matrix is normalized

graph

Whether or not a graphic is displayed.

See Also

evaluation, performance, splitdata

Examples

Run this code
require ("datasets")
data (iris)
d = splitdata (iris, 5)
model = NB (d$train.x, d$train.y)
pred = predict (model, d$test.x)
confusion (d$test.y, pred)

Run the code above in your browser using DataLab