validate_response {collinear}R Documentation

Validate the 'response' argument for target encoding of non-numeric variables

Description

Requires the argument 'df' to be validated with validate_df().

Usage

validate_response(df = NULL, response = NULL, decimals = 4)

Arguments

df

(required; data frame) A validated data frame with numeric and/or character predictors predictors, and optionally, a response variable. Default: NULL.

response

(optional, character string) Name of a numeric response variable. Character response variables are ignored. Default: NULL.

decimals

(required, integer) number of decimal places for the zero variance test. Default: 4

Value

character string with name of the response

Author(s)

Blas M. Benito

Examples


data(
  vi
)

#validating example data frame
vi <- validate_df(
  df = vi
)

#validating example predictors
response <- validate_response(
  df = vi,
  response = "vi_mean"
)

#tagged as validated
attributes(response)$validated


[Package collinear version 1.1.1 Index]