classify_bags | R Documentation |
Formally, this function applies max()
on y
for each level of bags
.
classify_bags(y, bags, condense = TRUE)
y |
A numeric, character, or factor vector of bag labels for each
instance. Must satisfy |
bags |
A vector specifying which instance belongs to each bag. Can be a string, numeric, of factor. |
condense |
A logical (default |
a named vector of length length(unique(b))
which gives the
classification for each bag. Names come from bags
.
Sean Kent
y <- c(1, 0, 0, 1, 1, 1, 0, 0, 0) bags <- rep(1:3, each = 3) classify_bags(y, bags) classify_bags(y, bags, condense = FALSE) # works with regular vector too scores <- 1:9 classify_bags(scores, bags)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.