class_docstr: Score based on marginal distributions.
  
  To predict scores for the tails, we make the following simplification of $P(t | h, r)$:
  
  .. math ::
      P(t | h, r) \sim P(t | h) * P(t | r)
  
  Depending on the settings, we either set $P(t | *) = \frac{1}{n}$ where $n$ is the number of entities,
  or estimate them by counting occurrences in the training triples.
  
  .. note ::
      This model cannot make use of GPU acceleration, since internally it uses scipy's sparse matrices.
  
  ---
  name: Marginal Distribution Baseline
  citation:
      author: Berrendorf
      year: 2021
      link: https://github.com/pykeen/pykeen/pull/514
      github: pykeen/pykeen
code: def score_h(
      self, rt_batch: torch.LongTensor, **kwargs
  ) -> torch.FloatTensor:  # noqa: D102
      return marginal_score(
          entity_relation_batch=rt_batch.flip(1),
          per_entity=self.head_per_tail,
          per_relation=self.head_per_relation,
          num_entities=self.num_entities,
      )
  
imports: from typing import Optional
  import numpy
  import torch
  from .utils import get_csr_matrix, get_relation_similarity, marginal_score
  from ..base import Model
  from ...triples import CoreTriplesFactory
  from ...typing import InductiveMode
label_desc: Use image node_id 3 for calling the MarginalDistributionBaseline obj's underlying member method code with example usage: obj.score_h(rt_batch) and returns: marginal_score