class_docstr: Tests for uncertainty prediction.
class_docstr_tok: ["Tests","for","uncertainty","prediction","."]
docstr: General testing of uncertainty prediction.
docstr_tok: ["General","testing","of","uncertainty","prediction","."]
code: def _test_predict_uncertain(
      self,
      method: Callable[
          ..., Tuple[torch.FloatTensor, torch.FloatTensor]
      ],
      expected_shape: Tuple[int, ...],
      **kwargs,
  ):
      """General testing of uncertainty prediction."""
      result = method(
          model=self.model,
          num_samples=self.num_samples,
          **kwargs,
      )
      assert isinstance(result, UncertainPrediction)
      assert (result.uncertainty >= 0).all()
      assert result.score.shape == expected_shape
      assert result.uncertainty.shape == expected_shape
  
file_path: pykeen/tests/test_uncertainty.py
imports: from typing import Callable, Tuple
  import torch
  from pykeen.models import ERMLPE, TransE
  from pykeen.models.uncertainty import UncertainPrediction, predict_h_uncertain, predict_hrt_uncertain, predict_r_uncertain, predict_t_uncertain
  from tests import cases
label_desc: Use image node_id 1 for calling the UncertaintyPredictionTestCase obj's underlying member method code with example usage: obj._test_predict_uncertain(method, expected_shape) without return types