bsnsing | R Documentation |
Depending on the arguments provided, either bsnsing.default
or bsnsing.formula
will be called.
bsnsing(x, ...)
x |
a data frame or a |
... |
arguments passed on to |
an object of class bsnsing
for a two-class problem or an object of class mbsnsing
for a multi-class problem.
# Use the formula format bs <- bsnsing(Class~., data = BreastCancer) summary(bs) # For 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 predict(bs, type = 'class') # the fitted class membership predict(bs, type = 'prob') # the fitted probabilities # Use the (x, y) format, y must have two levels y <- ifelse(iris$Species == 'setosa', 1L, 0L) x <- iris[, c('Sepal.Length', 'Sepal.Width', 'Petal.Length', 'Petal.Width')] bs <- bsnsing(x, y, verbose = TRUE) summary(bs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.