Learn R Programming

tidyrules (version 0.2.7)

varSpec: Get variable specification for a Cubist/C5 object

Description

Obtain variable names, type (numeric, ordered, factor) and levels as a tidytable

Usage

varSpec(object)

Value

A tidytable with three columns: variable(character), type(character) and levels(a list-column). For numeric variables, levels are set to NA.

Arguments

object

Cubist/C5 object

Examples

Run this code
if (FALSE) {
data("attrition", package = "modeldata")
cols_att = setdiff(colnames(attrition), c("MonthlyIncome", "Attrition"))

cb_att = Cubist::cubist(x = attrition[, cols_att],
                        y = attrition[["MonthlyIncome"]]
                        )
varSpec(cb_att)
}

Run the code above in your browser using DataLab