rand_argmax#

skactiveml.utils.rand_argmax(a, random_state=None, **argmax_kwargs)[source]#

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

Parameters:
aarray-like

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

random_stateint, RandomState instance or None, default=None

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

argmax_kwargsdict-like

Keyword argument passed to numpy function argmax.

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.argmax, including keepdims. With axis=None and keepdims=True, the index refers to the flattened array.