dict_selectors_sequential | R Documentation |
Selector
that wraps multiple other Selector
s given during construction and uses them for selection in sequence.
This makes it possible for one Selector
to discard a few individuals, followed by a second Selector
to
discard more, etc., until n_select
individuals are remaining.
Given that there are nrow(values)
input individuals in an operation, and n_select
individuals requested to be selected,
the operation calls selector_i
for i
in 1 ... length(selectors)
to reduce the number of individuals in this pipeline.
The relative quantity by which the number of individuals is reduced in each step is determined by the configuration parameters
reduction_1
, reduction_2
, etc., and also dependent on the sum of these values, in the following denoted, with a slight abuse of notation, by sum[reduction_#]
.
Let the number of individuals passed to step i
be denoted by n_values[i]
, and the number of individuals requested to be
selected by that step be denoted as n_select_[i]
. In particular, n_values[1] == nrow(values)
, and n_select_[length(selectors)] == n_select
.
When reduction_by_factor
is TRUE
, then the reduction at step i
is done by a factor, meaning that n_values[i] / n_select_[i]
is set (up to rounding).
This factor is (nrow(values) / n_select) ^ (reduction_i / sum[reduction_#])
.
When reduction_by_factor
is FALSE
, then the reduction at step i
is done by absolute differences, meaning that n_values[i] - n_select_[i]
is set (up to rounding).
This difference is (nrow(values) - n_select) * (reduction_i / sum[reduction_#])
, with sum[reduction_#]
as above.
In particular, this means that when all reduction_#
values are the same and reduction_by_factor
is TRUE
, then each operation reduces the number of
individuals in the pipeline by the same factor. When reduction_by_factor
is FALSE
, then each operation removes the same absolute number of individuals.
While the illustrations are done with the assumption that nrow(values) >= n_select
, they hold equivalently with nrow(values) < n_select
.
All except the last Selector
s are called with group_size
set to their n_select
value; the last Selector
is called with the group_size
value
given as input.
This operator has the configuration parameters of the Selector
s that it wraps: The configuration parameters of the operator given to the selectors
construction
argument are prefixed with "selector_1"
, "selector_2"
, ... up to "selector_#"
, where #
is length(selectors)
.
Additional configuration parameters:
reduction_1
, reduction_2
, ... :: numeric(1)
Relative reduction done by selector_1
, selector_2
, ..., as described in the section Algorithm. The values are all initialized to 1, meaning
the same factor (when reduction_by_factor
is TRUE
) or absolute number (otherwise) of reduction by each operation.
reduction_by_factor
:: logical(1)
Whether to do reduction by factor (TRUE
) or absolute number (FALSE
), as described in Algorithm. Initialized to TRUE
.
Supported Domain
classes are the set intersection of supported classes of the Selector
s given in selectors
.
This Selector
can be created with the short access form sel()
(sels()
to get a list), or through the the dictionary
dict_selectors
in the following way:
# preferred: sel("sequential", <selectors>) sels("sequential", <selectors>) # takes vector IDs, returns list of Selectors # long form: dict_selectors$get("sequential", <selectors>)
miesmuschel::MiesOperator
-> miesmuschel::Selector
-> SelectorSequential
selectors
(list
of Selector
)
Selector
s being wrapped. These operators get run sequentially in order.
new()
Initialize the SelectorSequential
object.
SelectorSequential$new(selectors)
selectors
(list
of Selector
)
Selector
s to wrap. The operations are run in order given to selectors
.
The constructed object gets a clone of this argument. The $selectors
field will reflect this value.
prime()
See MiesOperator
method. Primes both this operator, as well as the wrapped operators
given to selectors
during construction.
SelectorSequential$prime(param_set)
param_set
(ParamSet
)
Passed to MiesOperator
$prime()
.
invisible self
.
clone()
The objects of this class are cloneable with this method.
SelectorSequential$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other selectors:
Selector
,
SelectorScalar
,
dict_selectors_best
,
dict_selectors_maybe
,
dict_selectors_null
,
dict_selectors_proxy
,
dict_selectors_random
,
dict_selectors_tournament
Other selector wrappers:
dict_selectors_maybe
,
dict_selectors_proxy
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.