bsnsing.formula {bsnsing} | R Documentation |
Learn a Classification Tree using Boolean Sensing
Description
The program builds a binary classification tree for each unique value in the response variable. Each tree classifies a target value against all the other values (internally coded as 'all.other') in the response variable. If the response variable is a numeric type, the number of unique values must not exceed 30. There is no programmatic restriction on the number of unique levels for a factor response.
Usage
## S3 method for class 'formula'
bsnsing(formula, data, subset, na.action = stats::na.pass, ...)
Arguments
formula |
an object of class " |
data |
an optional data frame, list or environment (or object coercible by |
subset |
an optional vector specifying a subset (in terms of index numbers, not actual data) of observations to be used in the fitting process. |
na.action |
a function which indicates what should happen when the data contain NAs. If |
... |
additional arguments to be passed to the low level fitting functions, e.g., elements in the |
Value
an object of bsnsing
for a two-class problem or an object of mbsnsing
for a multi-class problem.
Examples
# Multi-class classification
bs <- bsnsing(Species ~ ., data = iris)
summary(bs)
summary(bs[[1]]) # display the tree for the first class
summary(bs[[2]]) # display the tree for the second class
summary(bs[[3]]) # display the tree for the third class
# Two-class classification
bs <- bsnsing(origin ~ mpg + displacement + horsepower + weight, data = auto, verbose = TRUE)
summary(bs)