Learn R Programming

fdm2id (version 0.9.6)

cost.curves: Plot Cost Curves

Description

This function plots Cost Curves of several classification predictions.

Usage

cost.curves(predictions, gt, methods.names = NULL)

Value

The evaluation of the predictions (numeric value).

Arguments

predictions

The predictions of a classification model (factor or vector).

gt

Actual labels of the dataset (factor or vector).

methods.names

The name of the compared methods (vector).

See Also

roc.curves, performance

Examples

Run this code
require (datasets)
data (iris)
d = iris
levels (d [, 5]) = c ("+", "+", "-") # Building a two classes dataset
model.nb = NB (d [, -5], d [, 5])
model.lda = LDA (d [, -5], d [, 5])
pred.nb = predict (model.nb, d [, -5])
pred.lda = predict (model.lda, d [, -5])
cost.curves (cbind (pred.nb, pred.lda), d [, 5], c ("NB", "LDA"))

Run the code above in your browser using DataLab