bsnsing.formula | R Documentation |
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.
## S3 method for class 'formula' bsnsing(formula, data, subset, na.action = stats::na.pass, ...)
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 |
an object of bsnsing
for a two-class problem or an object of mbsnsing
for a multi-class problem.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.