| cla_glm | R Documentation |
Logistic regression classifier using stats::glm with binomial family.
cla_glm(attribute, positive, features = NULL, threshold = 0.5)
attribute |
target attribute name |
positive |
positive class label |
features |
optional vector of feature names (default: all except attribute) |
threshold |
probability threshold for positive class |
returns a cla_glm object
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.