R/SelectorSequential.R
dict_selectors_sequential.Rd
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 Param
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:
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
miesmuschel::MiesOperator
-> miesmuschel::Selector
-> SelectorSequential
prime()
See MiesOperator
method. Primes both this operator, as well as the wrapped operators
given to selectors
during construction.
param_set
(ParamSet
)
Passed to MiesOperator
$prime()
.
invisible self
.