View source: R/confusion.matrix.R
confusion.matrix | R Documentation |
Create a confusion matrix from actual and predicted values. Note that this function follows the convention of placing "Predicted" as the row variable and "Actual/Correct" as the column variable for the returned contingency table. This is unlikely to be a compatible format with other packages that use the reverse convention for predicted/actual.
confusion.matrix(
actual,
predicted,
actual.positive.fn = function(actual) {
ifelse(actual == 1, 1, 0)
},
predicted.positive.fn = function(predicted) {
ifelse(predicted == 1, 1, 0)
}
)
actual |
A vector of values identifying the actual value (default 0,1 or use actual.positive.fn to convert) |
predicted |
A vector of values identifying the predicted value (default 0,1 or use predicted.positive.fn to convert) |
actual.positive.fn |
A function that takes values present in actual and converts them to 0,1 |
predicted.positive.fn |
A function that takes values in predicted and converts them to 0,1 |
A 2x2 matrix showing agreement between actual and predicted.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.