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)
| 70 | |
| 71 | |
| 72 | def 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 | |
| 86 | def weighted_random(weights: np.ndarray, n_instances: int = 1) -> np.ndarray: |
no test coverage detected
searching dependent graphs…