choose_int#
- skrub.choose_int(low, high, *, log=False, n_steps=None, name=None, default=None)[source]#
A choice of integers from a numeric range.
When a pipeline is used without hyperparameter tuning, the outcome of this choice is the middle of the range (possibly on a
log
scale). Pass an int as thedefault
argument to set the default outcome.- Parameters:
- low
int
The start of the range.
- high
int
Then end of the range. It is included in the possible outcomes.
- log
bool
, optional (default=False) Whether sampling should be done on a logarithmic scale.
- n_steps
int
, optional (default=None) If not
None
, a grid ofn_steps
values across the range is defined and sampling is done on that grid. This can be useful to limit the number of unique values that get sampled, for example to improve the effectiveness of caching. However, it means a much more restricted space of possible values gets explored.- name
str
, optional (default=None) If not
None
,name
is used when displaying search results and can also be used to override the choice’s value by setting it in the environment containing a pipeline’s inputs.- default
int
, optional (default=None) If provided, override the choice’s default value when hyperparameter search is not used. Otherwise the default value is the integer closest to the middle of the range (either on a linear or logarithmic scale depending on the value of
log
).
- low
- Returns:
- numeric choice
An object representing this choice, which can be used in a skrub pipeline.
See also
choose_bool
Construct a choice between False and True.
choose_float
Construct a choice of floating-point numbers from a numeric range.
choose_from
Construct a choice among several possible outcomes.