cla_glm: Logistic regression (GLM)

View source: R/cla_glm.R

cla_glmR Documentation

Logistic regression (GLM)

Description

Logistic regression classifier using stats::glm with binomial family.

Usage

cla_glm(attribute, positive, features = NULL, threshold = 0.5)

Arguments

attribute

target attribute name

positive

positive class label

features

optional vector of feature names (default: all except attribute)

threshold

probability threshold for positive class

Value

returns a cla_glm object

Examples

data(iris)
iris_bin <- iris
iris_bin$IsVersicolor <- factor(ifelse(
 iris_bin$Species == "versicolor",
 "versicolor",
 "not_versicolor"
))
model <- cla_glm("IsVersicolor", positive = "versicolor")
model <- suppressWarnings(fit(model, iris_bin))
pred <- predict(model, iris_bin)
table(pred, iris_bin$IsVersicolor)

daltoolbox documentation built on Feb. 10, 2026, 9:06 a.m.