mi_df {mildsvm} | R Documentation |
Build a multiple instance (MI) data frame
Description
mi_df()
constructs a data frame that corresponds to Multiple Instance (MI)
data. A mi_df
object must have two special columns:
-
bag_label
, determines the label of each bag, typically fromc(0, 1)
-
bag_name
, character or factor that specifies the bag that each sample belongs to.
Usage
mi_df(
bag_label = character(),
bag_name = character(),
...,
instance_label = NULL
)
Arguments
bag_label |
A |
bag_name |
A |
... |
A set of name-value pairs. These construct the covariates for a
|
instance_label |
A |
Details
We refer to the rows of a mi_df
as instances. Each instance is
contained in a bag, with a corresponding label. Bags will typically have
several instances within them. Instance labels can be provided, but they will
be pulled in as an attribute.
Value
A 'mi_df' object. This data.frame-like has columns bag_label
,
bag_name
, and those specified in ...
. It also inherits from the
'tbl_df'
and 'tbl'
classes.
Author(s)
Sean Kent
See Also
-
as_mi_df()
to convert data.frames tomi_df
s.
Examples
mi_df('bag_label' = factor(c(1, 1, 0)),
'bag_name' = c(rep('bag_1', 2), 'bag_2'),
'X1' = c(-0.4, 0.5, 2),
'instance_label' = c(0, 1, 0))