rand_argmin#

skactiveml.utils.rand_argmin(a, random_state=None, **argmin_kwargs)[source]#

Returns index of minimum value. In case of ties, a randomly selected index of the minimum elements is returned.

Parameters:
aarray-like

Indexable data-structure of whose minimum element’s index is to be determined.

random_stateint or RandomState instance or None, default=None

Determines random number generation for shuffling the data. Pass an int for reproducible results across multiple function calls.

argmin_kwargsdict-like

Keyword argument passed to numpy function argmin.

Returns:
index_arraynumpy.ndarray of ints

Indices of the selected elements, always at least one-dimensional. For multi-dimensional a, axis=None and keepdims=False return coordinates of one element, with shape (a.ndim,). Otherwise, the shape follows numpy.argmin, including keepdims. With axis=None and keepdims=True, the index refers to the flattened array.