dummy_classifier: dummy classifier for a categorical variable.

View source: R/dummy_classifier.R

dummy_classifierR Documentation

dummy classifier for a categorical variable.

Description

dummy classifier for a categorical variable.

Usage

dummy_classifier(
  y,
  strategy = "proportional",
  constant = NULL,
  random_state = NULL
)

Arguments

y

a categorical vector, containing the outcomes of interest

strategy

a strategy from "constant", "most_frequent", "proportional", "uniform", or "stratified".

constant

a constant value for the constant strategy.

random_state

a random seed.

Value

a list

Examples

# Split the data into training and testing sets
set.seed(2023)
index <- sample(1:nrow(iris), nrow(iris) * 0.8)
train_data <- iris[index,]
test_data <- iris[-index,]
dummy_model <- dummy_classifier(train_data$Species, strategy = "proportional", random_state = 2024)
dummy_model

basemodels documentation built on Aug. 9, 2023, 9:09 a.m.