evaluatePrediction: Evaluate Predicted Result

View source: R/Modelling.R

evaluatePredictionR Documentation

Evaluate Predicted Result

Description

This function can evaluate prediction based on reference labels and predicted results.

Usage

evaluatePrediction(reference, prediction, positive.class = NULL)

Arguments

reference

a factor/character string of classes to be used as the true results.

prediction

a factor/character string of predicted classes.

positive.class

NULL or string. Which class is the positive class? Should be one of the classes in label column. The first class in label column will be selected as the positive class if leave positive.class = NULL.

Details

reference and prediction should have exactly the same classes. More information please refer to confusionMatrix.

Value

A dataframe that reports TP, TN, FP, FN, Sensitivity, Specificity, Accuracy, F-Measure (F1-Score), MCC (Matthews Correlation Coefficient), Cohen's Kappa, etc.

References

Kuhn M. Building predictive models in R using the caret package. Journal of statistical software. 2008; 28(5):1-26.

See Also

confusionMatrix

Examples


# Following codes only show how to use this function
# and cannot reflect the genuine performance of tools or classifiers.

data(demoPositiveSeq)
seqRNA <- demoPositiveSeq$RNA.positive
seqPro <- demoPositiveSeq$Pro.positive

# Predicting ncRNA-protein pairs using RPISeq (web-based):

Res_RPISeq <- run_RPISeq(seqRNA = seqRNA, seqPro = seqPro,
                         parallel.cores = 2) # Network is required.

# Evaluating the result:

perf_RPISeq <- evaluatePrediction(reference = rep("Non.Interact", 20),
                                  prediction = Res_RPISeq$RPISeq_Web_RF_pred,
                                  positive.class = "Non.Interact")


HAN-Siyu/ncProR documentation built on Nov. 3, 2023, 12:08 a.m.