class_docstr: Class providing functionality for computing operations related to interval bounds
class_docstr_tok: ["Class","providing","functionality","for","computing","operations","related","to","interval","bounds"]
docstr: Check if the data has been certifiably classified correct.
  
  :param preds: interval predictions
  :param labels: associated labels (not one-hot encoded).
  :return: array of True or False if predictions are certifiable
docstr_tok: ["Check","if","the","data","has","been","certifiably","classified","correct",".",":","param","preds",":","interval","predictions",":","param","labels",":","associated","labels","(","not","one-hot","encoded",")",".",":","return",":","array","of","True","or","False","if","predictions","are","certifiable"]
code: def certify(preds: np.ndarray, labels: np.ndarray) -> np.ndarray:
      """
      Check if the data has been certifiably classified correct.
  
      :param preds: interval predictions
      :param labels: associated labels (not one-hot encoded).
      :return: array of True or False if predictions are certifiable
      """
  
      cert_bounds = np.copy(
          preds[:, 1]
      )  # Take the upper bounds of all the predictions
      for i, label in enumerate(labels):
          cert_bounds[i, label] = preds[
              i, 0, label
          ]  # Replace the correct prediction with its lower bound
      return np.argmax(cert_bounds, axis=1) == labels
  
imports: from typing import List, Union, Tuple, Optional
  import torch
  import numpy
label_desc: Use image node_id 2 for calling the PyTorchIntervalBounds obj's underlying member method code with example usage: obj.certify(preds, labels) and returns: unknown