class_docstr: Abstract class that defines a Heuristic.
  
  Args:
      shuffle_prop (float): shuffle proportion.
      reverse (bool): True if the most uncertain sample has the highest value.
      reduction (Union[str, Callable]): Reduction used after computing the score.
class_docstr_tok: ["Abstract","class","that","defines","a","Heuristic",".","Args",":","shuffle_prop","(","float",")",":","shuffle","proportion",".","reverse","(","bool",")",":","True","if","the","most","uncertain","sample","has","the","highest","value",".","reduction","(","Union","[","str",",","Callable","]",")",":","Reduction","used","after","computing","the","score","."]
docstr: Get the uncertainties.
  
  Args:
      predictions (ndarray): Array of predictions
  
  Returns:
      Array of uncertainties
docstr_tok: ["Get","the","uncertainties",".","Args",":","predictions","(","ndarray",")",":","Array","of","predictions","Returns",":","Array","of","uncertainties"]
code: def get_uncertainties(self, predictions):
      """
      Get the uncertainties.
  
      Args:
          predictions (ndarray): Array of predictions
  
      Returns:
          Array of uncertainties
  
      """
      if isinstance(predictions, Tensor):
          predictions = predictions.numpy()
      scores = self.compute_score(predictions)
      scores = self.reduction(scores)
      if not np.all(np.isfinite(scores)):
          fixed = 0.0 if self.reversed else 10000
          warnings.warn(
              f"Invalid value in the score, will be put to {fixed}",
              UserWarning,
          )
          scores[~np.isfinite(scores)] = fixed
      return scores
  
imports: import types
  import warnings
  from collections.abc import Sequence
  from functools import wraps
  from typing import List
  import numpy
  import scipy.stats
  import torch
  from scipy.special import xlogy
  from torch import Tensor
  from baal.utils.array_utils import to_prob
label_desc: Use image node_id 4 for calling the AbstractHeuristic obj's underlying member method code with example usage: obj.get_uncertainties(predictions) and returns: scores