classify_bags {mildsvm} | R Documentation |
Classify y from bags
Description
Formally, this function applies max()
on y
for each level of bags
.
Usage
classify_bags(y, bags, condense = TRUE)
Arguments
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 |
Value
a named vector of length length(unique(b))
which gives the
classification for each bag. Names come from bags
.
Author(s)
Sean Kent
Examples
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)
[Package mildsvm version 0.4.0 Index]