Regressor standard deviation sampling strategy. Args: regressor: The regressor 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 r
(regressor: BaseEstimator, X: modALinput,
n_instances: int = 1, random_tie_break=False,
**predict_kwargs)
| 184 | |
| 185 | |
| 186 | def max_std_sampling(regressor: BaseEstimator, X: modALinput, |
| 187 | n_instances: int = 1, random_tie_break=False, |
| 188 | **predict_kwargs) -> np.ndarray: |
| 189 | """ |
| 190 | Regressor standard deviation sampling strategy. |
| 191 | |
| 192 | Args: |
| 193 | regressor: The regressor for which the labels are to be queried. |
| 194 | X: The pool of samples to query from. |
| 195 | n_instances: Number of samples to be queried. |
| 196 | random_tie_break: If True, shuffles utility scores to randomize the order. This |
| 197 | can be used to break the tie when the highest utility score is not unique. |
| 198 | **predict_kwargs: Keyword arguments to be passed to :meth:`predict` of the CommiteeRegressor. |
| 199 | |
| 200 | Returns: |
| 201 | The indices of the instances from X chosen to be labelled. |
| 202 | The standard deviation of the chosen instances. |
| 203 | |
| 204 | """ |
| 205 | _, std = regressor.predict(X, return_std=True, **predict_kwargs) |
| 206 | std = std.reshape(X.shape[0], ) |
| 207 | |
| 208 | if not random_tie_break: |
| 209 | return multi_argmax(std, n_instances=n_instances) |
| 210 | |
| 211 | return shuffled_argmax(std, n_instances=n_instances) |
nothing calls this directly
no test coverage detected
searching dependent graphs…