MCPcopy Create free account
hub / github.com/modAL-python/modAL / multi_argmin

Function multi_argmin

modAL/utils/selection.py:72–83  ·  view source on GitHub ↗

return the indices and values of the n_instances smallest values. Args: values: Contains the values to be selected from. n_instances: Specifies how many indices and values to return. Returns: The indices and values of the n_instances smallest values.

(values: np.ndarray, n_instances: int = 1)

Source from the content-addressed store, hash-verified

70
71
72def multi_argmin(values: np.ndarray, n_instances: int = 1) -> np.ndarray:
73 """
74 return the indices and values of the n_instances smallest values.
75
76 Args:
77 values: Contains the values to be selected from.
78 n_instances: Specifies how many indices and values to return.
79 Returns:
80 The indices and values of the n_instances smallest values.
81 """
82 indexes, index_values = multi_argmax(-values, n_instances)
83 return indexes, -index_values
84
85
86def weighted_random(weights: np.ndarray, n_instances: int = 1) -> np.ndarray:

Callers 3

min_confidenceFunction · 0.90
margin_samplingFunction · 0.90
expected_error_reductionFunction · 0.90

Calls 1

multi_argmaxFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…