fn_error {scorecardModelUtils}R Documentation

Computes error measures between observed and predicted values

Description

The function takes the input dataframe with observed and predicted columns and computes mean absolute error, mean squared error and root mean squared error terms.

Usage

fn_error(base, observed_col, predicted_col)

Arguments

base

input dataframe

observed_col

column / field name of the observed event

predicted_col

column / field name of the predicted event

Value

An object of class "fn_error" is a list containing the following components:

mean_abs_error

mean absolute error between observed and predicted value

mean_sq_error

mean squared error between observed and predicted value

root_mean_sq_error

root mean squared error between observed and predicted value

Author(s)

Arya Poddar <aryapoddar290990@gmail.com>

Examples

data <- iris
data$Species <- as.character(data$Species)
suppressWarnings(RNGversion('3.5.0'))
set.seed(11)
data$Y <- sample(0:1,size=nrow(data),replace=TRUE)
data$Y_pred <- sample(0:1,size=nrow(data),replace=TRUE)
fn_error_list <- fn_error(base = data,observed_col = "Y",predicted_col = "Y_pred")
fn_error_list$mean_abs_error
fn_error_list$mean_sq_error
fn_error_list$root_mean_sq_error

[Package scorecardModelUtils version 0.0.1.0 Index]