class_docstr: A rank-based evaluator for KGE models.
class_docstr_tok: ["A","rank-based","evaluator","for","KGE","models","."]
docstr: Finalize result with confidence estimation via bootstrapping.
  
  Start by training a model (here, only for a one epochs)
  
  >>> from pykeen.pipeline import pipeline
  >>> result = pipeline(dataset="nations", model="rotate", training_kwargs=dict(num_epochs=1))
  
  Create an evaluator with `clear_on_finalize` set to `False`, e.g., via
  
  >>> from pykeen.evaluation import evaluator_resolver
  >>> evaluator = evaluator_resolver.make("rankbased", clear_on_finalize=False)
  
  Evaluate *once*, this time ignoring the result
  
  >>> evaluator.evaluate(model=result.model, mapped_triples=result.training.mapped_triples)
  
  Now, call `finalize_with_confidence` to obtain estimates for metrics together with confidence intervals
  
  >>> evaluator.finalize_with_confidence(n_boot=10)
  
  :param estimator:
      the estimator of central tendency.
  :param ci:
      the confidence interval
  :param n_boot:
      the number of resamplings to use for bootstrapping
  :param seed:
      the random seed
  
  :return:
      a dictionary from metric names to (central tendency, confidence) pairs
code: def finalize_with_confidence(
      self,
      estimator: Union[
          str, Callable[[Sequence[float]], float]
      ] = np.median,
      ci: Union[int, str, Callable[[Sequence[float]], float]] = 90,
      n_boot: int = 1_000,
      seed: int = 42,
  ) -> Mapping[str, Tuple[float, float]]:
      """Finalize result with confidence estimation via bootstrapping.
  
      Start by training a model (here, only for a one epochs)
  
      >>> from pykeen.pipeline import pipeline
      >>> result = pipeline(dataset="nations", model="rotate", training_kwargs=dict(num_epochs=1))
  
      Create an evaluator with `clear_on_finalize` set to `False`, e.g., via
  
      >>> from pykeen.evaluation import evaluator_resolver
      >>> evaluator = evaluator_resolver.make("rankbased", clear_on_finalize=False)
  
      Evaluate *once*, this time ignoring the result
  
      >>> evaluator.evaluate(model=result.model, mapped_triples=result.training.mapped_triples)
  
      Now, call `finalize_with_confidence` to obtain estimates for metrics together with confidence intervals
  
      >>> evaluator.finalize_with_confidence(n_boot=10)
  
      :param estimator:
          the estimator of central tendency.
      :param ci:
          the confidence interval
      :param n_boot:
          the number of resamplings to use for bootstrapping
      :param seed:
          the random seed
  
      :return:
          a dictionary from metric names to (central tendency, confidence) pairs
      """
      return {
          k: summarize_values(vs, estimator=estimator, ci=ci)
          for k, vs in self.finalize_multi(
              n_boot=n_boot, seed=seed
          ).items()
      }
  
imports: from __future__ import annotations
  import functools
  import itertools
  import logging
  import math
  import random
  import re
  from collections import defaultdict
  from typing import Callable, DefaultDict, Iterable, List, Mapping, MutableMapping, NamedTuple, Optional, Sequence, Tuple, Type, TypeVar, Union, cast
  import numpy
  import numpy.random
  import pandas
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from .evaluator import Evaluator, MetricResults, prepare_filter_triples
  from .ranks import Ranks
  from ..constants import COLUMN_LABELS, TARGET_TO_KEY_LABELS, TARGET_TO_KEYS
  from ..metrics.ranking import HITS_METRICS, RankBasedMetric, rank_based_metric_resolver
  from ..metrics.utils import Metric
  from ..triples.triples_factory import CoreTriplesFactory
  from ..typing import LABEL_HEAD, LABEL_TAIL, RANK_REALISTIC, RANK_TYPE_SYNONYMS, RANK_TYPES, SIDE_BOTH, SIDES, ExtendedTarget, MappedTriples, RankType, Target, normalize_rank_type, normalize_target
label_desc: Use image node_id 6 for calling the RankBasedEvaluator obj's underlying member method code with example usage: obj.finalize_with_confidence(estimator, ci, n_boot, seed) and returns: unknown