class_docstr: A mock evaluator for testing early stopping.
class_docstr_tok: ["A","mock","evaluator","for","testing","early","stopping","."]
code: def __init__(
      self,
      key: Optional[Tuple[str, ExtendedTarget, RankType]] = None,
      values: Optional[Iterable[float]] = None,
      automatic_memory_optimization: bool = True,
      random_state: Optional[int] = None,
  ) -> None:
      super().__init__(
          automatic_memory_optimization=automatic_memory_optimization
      )
      self.key = RankBasedMetricResults.key_from_string(
          s=None if key is None else ".".join((*key[1:], key[0]))
      )
      self.random_state = random_state
      if values is None:
          self.values = self.values_iter = None
      else:
          self.values = tuple(values)
          self.values_iter = iter(self.values)
  
file_path: pykeen/tests/mocks.py
imports: from typing import Iterable, Optional, Tuple
  import torch
  from torch import nn
  from pykeen.evaluation import Evaluator, MetricResults, RankBasedMetricResults
  from pykeen.nn import Representation
  from pykeen.typing import ExtendedTarget, MappedTriples, RankType, Target
label_desc: Use image node_id 1 to create a new MockEvaluator object from inherited base classes: Evaluator with example: obj = MockEvaluator(key, values, automatic_memory_optimization, random_state)