accuracy_score: Accuracy Score

Description Usage Arguments Value Examples

View source: R/accuracy_score.R

Description

Given a set of predictions from glm_predict and the correct data, returns the accuracy of the predictions.

Usage

1
accuracy_score(correct, predictions, normalize = TRUE)

Arguments

correct

True/correct labels.

predictions

Predicted labels.

normalize

Normalize the accuracy to the number of samples. default = TRUE.

Value

accuracy (numeric): If normalize==TRUE, this is the fraction of correctly classified examples. Otherwise, returns the number correct predictions.

Examples

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

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