Skip to contents

The FSelectorBatch implements the optimization algorithm.


FSelectorBatch is an abstract base class that implements the base functionality each fselector must provide. A subclass is implemented in the following way:

  • Inherit from FSelectorBatch.

  • Specify the private abstract method $.optimize() and use it to call into your optimizer.

  • You need to call instance$eval_batch() to evaluate design points.

  • The batch evaluation is requested at the FSelectInstanceBatchSingleCrit/FSelectInstanceBatchMultiCrit object instance, so each batch is possibly executed in parallel via mlr3::benchmark(), and all evaluations are stored inside of instance$archive.

  • Before the batch evaluation, the bbotk::Terminator is checked, and if it is positive, an exception of class "terminated_error" is generated. In the latter case the current batch of evaluations is still stored in instance, but the numeric scores are not sent back to the handling optimizer as it has lost execution control.

  • After such an exception was caught we select the best set from instance$archive and return it.

  • Note that therefore more points than specified by the bbotk::Terminator may be evaluated, as the Terminator is only checked before a batch evaluation, and not in-between evaluation in a batch. How many more depends on the setting of the batch size.

  • Overwrite the private super-method .assign_result() if you want to decide how to estimate the final set in the instance and its estimated performance. The default behavior is: We pick the best resample experiment, regarding the given measure, then assign its set and aggregated performance to the instance.

Private Methods

  • .optimize(instance) -> NULL
    Abstract base method. Implement to specify feature selection of your subclass. See technical details sections.

  • .assign_result(instance) -> NULL
    Abstract base method. Implement to specify how the final feature subset is selected. See technical details sections.


There are several sections about feature selection in the mlr3book.

The gallery features a collection of case studies and demos about optimization.

Super class

mlr3fselect::FSelector -> FSelectorBatch


Inherited methods

Method new()

Creates a new instance of this R6 class.


  id = "fselector_batch",
  packages = character(),
  label = NA_character_,
  man = NA_character_



Identifier for the new instance.


Set of control parameters.


Set of properties of the fselector. Must be a subset of mlr_reflections$fselect_properties.


Set of required packages. Note that these packages will be loaded via requireNamespace(), and are not attached.


Label for this object. Can be used in tables, plot and text output instead of the ID.


String in the format [pkg]::[topic] pointing to a manual page for this object. The referenced help package can be opened via method $help().

Method optimize()

Performs the feature selection on a FSelectInstanceBatchSingleCrit or FSelectInstanceBatchMultiCrit until termination. The single evaluations will be written into the ArchiveBatchFSelect that resides in the FSelectInstanceBatchSingleCrit / FSelectInstanceBatchMultiCrit. The result will be written into the instance object.



Method clone()

The objects of this class are cloneable with this method.


FSelectorBatch$clone(deep = FALSE)



Whether to make a deep clone.