acc: Accuracy of the Model

View source: R/modeling.R

accR Documentation

Accuracy of the Model

Description

Calculates the accuracy of the model by taking the mean of the number of times the truth, y, equals the predicted, \hat{y}.

Usage

acc(y, yhat)

Arguments

y

A vector of the true y values

yhat

A vector of predicted \hat{y} values.

Value

The accuracy of the classification in numeric form.

Examples

# Set seed for reproducibility
set.seed(100)

# Generate data
n = 1e2

y = round(runif(n))
yhat = round(runif(n))

# Compute
o = acc(y, yhat)

coatless/balamuta documentation built on Nov. 16, 2023, 5:30 a.m.