ConfusionMatrix
    confusionMatrix(actual, predicted, cutoff = 0.5)

    Accuracy
    Accuracy is the percentage of correctly classi ed instances
    out of all instances.

    Kappas
    Kappa or Cohen’s Kappa is like classi cation accuracy, except that it is normalized at the
    baseline of random chance on your dataset. It is a more useful measure to use on problems
    that have an imbalance in the classes (e.g. a 70% to 30% split for classes 0 and 1 and you can
    achieve 70% accuracy by predicting all instances are for class 0).

    Sensitivity
    Sensitivity is the true positive rate also called the recall. It is the number of instances
    from the positive ( rst) class that actually predicted correctly.

    Specitivity
    Speci city is also called the true negative rate. Is the number of instances from the
    negative class (second class) that were actually predicted correctly.

    RMSE
    RMSE or Root Mean Squared Error is the average deviation of the predictions from the
    observations.

    R square
    R2 spoken as R Squared or also called the coecient of determination provides a goodness-
    of- t measure for the predictions to the observations.

    ROC
    ROC metrics are only suitable for binary classi cation problems (e.g. two classes).
    To calculate ROC information, you must change the summaryFunction in your trainControl to be
    twoClassSummary. This will calculate the Area Under ROC Curve (AUROC) also called just
    Area Under curve (AUC), sensitivity and speci city.

    1. # load packages
    2. library(caret)
    3. library(mlbench)
    4. # load the dataset
    5. data(PimaIndiansDiabetes)
    6. # prepare resampling method
    7. trainControl <- trainControl(method="cv", number=5, classProbs=TRUE,
    8. summaryFunction=twoClassSummary)
    9. set.seed(7)
    10. fit <- train(diabetes~., data=PimaIndiansDiabetes, method="glm", metric="ROC",
    11. trControl=trainControl)
    12. # display results
    13. print(fit)

    Logloss
    Logarithmic Loss (or LogLoss) is used to evaluate binary classi cation but it is more common
    for multi-class classi cation algorithms. Speci cally, it evaluates the probabilities estimated by
    the algorithms.

    1. # prepare resampling method
    2. trainControl <- trainControl(method="cv", number=5, classProbs=TRUE,
    3. summaryFunction=mnLogLoss)
    4. set.seed(7)
    5. fit <- train(Species~., data=iris, method="rpart", metric="logLoss", trControl=trainControl)
    6. # display results
    7. print(fit)