mlnext.score.eval_softmax

mlnext.score.eval_softmax(y: ndarray) ndarray[source]

Turns a multi-class softmax prediction into class labels.

Parameters:

y (np.ndarray) – Array with softmax probabilites

Returns:

Returns an array of shape (x, 1) with the class labels.

Return type:

np.ndarray

Example

>>> from mlnext import eval_softmax
>>> eval_softmax(np.array([[0.1, 0.9], [0.4, 0.6], [0.7, 0.3]]))
np.ndarray([[1], [1], [0]])