Maximum disagreement sampling strategy. Args: committee: The committee for which the labels are to be queried. X: The pool of samples to query from. n_instances: Number of samples to be queried. random_tie_break: If True, shuffles utility scores to randomize
(committee: BaseCommittee, X: modALinput,
n_instances: int = 1, random_tie_break=False,
**disagreement_measure_kwargs)
| 156 | |
| 157 | |
| 158 | def max_disagreement_sampling(committee: BaseCommittee, X: modALinput, |
| 159 | n_instances: int = 1, random_tie_break=False, |
| 160 | **disagreement_measure_kwargs) -> np.ndarray: |
| 161 | """ |
| 162 | Maximum disagreement sampling strategy. |
| 163 | |
| 164 | Args: |
| 165 | committee: The committee for which the labels are to be queried. |
| 166 | X: The pool of samples to query from. |
| 167 | n_instances: Number of samples to be queried. |
| 168 | random_tie_break: If True, shuffles utility scores to randomize the order. This |
| 169 | can be used to break the tie when the highest utility score is not unique. |
| 170 | **disagreement_measure_kwargs: Keyword arguments to be passed for the disagreement |
| 171 | measure function. |
| 172 | |
| 173 | Returns: |
| 174 | The indices of the instances from X chosen to be labelled. |
| 175 | The disagrerment metric of the chosen instances. |
| 176 | |
| 177 | """ |
| 178 | disagreement = KL_max_disagreement(committee, X, **disagreement_measure_kwargs) |
| 179 | |
| 180 | if not random_tie_break: |
| 181 | return multi_argmax(disagreement, n_instances=n_instances) |
| 182 | |
| 183 | return shuffled_argmax(disagreement, n_instances=n_instances) |
| 184 | |
| 185 | |
| 186 | def max_std_sampling(regressor: BaseEstimator, X: modALinput, |
nothing calls this directly
no test coverage detected
searching dependent graphs…