precision_score: Precision Score

Description Usage Arguments Value Examples

View source: R/precision_score.R

Description

Precision Score

Usage

1
precision_score(correct, predictions, pos_class = 1, neg_class = 0)

Arguments

correct

True/correct labels.

predictions

Predicted labels.

pos_class

Positive class label. Like the y value in glm, this must be between 0 and 1. default=1.

neg_class

Negative class label. Like the y value in glm, this must be between 0 and 1. default=0.

Value

precision (numeric): The precision (true positives / true positives + false positives) of the predictions

Examples

1
2
3
cancer_model <- glm(malignant ~ texture_mean, data=cancer_clean, family="quasibinomial")
cancer_preds <- glm_predict(cancer_model, "malignant")
precision <- precision_score(cancer_clean[["malignant"]], cancer_preds[[".prediction"]])

janetxinli/glmPredict documentation built on Jan. 1, 2021, 4:28 a.m.