function
Get prediction indices that are above threshold (confidence level).
get_predicted_threshold_indices(y_prob: npt.NDArray, y_pred: npt.NDArray, threshold: float = 0.5) -> npt.NDArrayGet prediction indices that are above threshold (confidence level). This is useful to remove weak predictions that can happen due to noisy data or poor model performance.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
y_prob | npt.NDArray | Required | Model output as probabilities |
y_pred | npt.NDArray | Required | Model predictions. Defaults to None. |
threshold | float | 0.5 | Confidence level |
Returns
| Type | Description |
|---|---|
npt.NDArray | npt.NDArray: Indices of y_prob that satisfy threshold |