class_docstr: A method for splitting triples.
class_docstr_tok: ["A","method","for","splitting","triples","."]
docstr: Split triples into clean groups.
  
  :param mapped_triples: shape: (n, 3)
      the ID-based triples
  :param random_state:
      the random state used to shuffle and split the triples
  :param ratios:
      There are three options for this argument.
      First, a float can be given between 0 and 1.0, non-inclusive. The first set of triples will get this
      ratio and the second will get the rest.
      Second, a list of ratios can be given for which set in which order should get what ratios as
      in ``[0.8, 0.1]``.
      The final ratio can be omitted because that can be calculated.
      Third, all ratios can be explicitly set in order such as in ``[0.8, 0.1, 0.1]`` where the sum of
      all ratios is 1.0.
  
  :return:
      A partition of triples, which are split (approximately) according to the ratios.
docstr_tok: ["Split","triples","into","clean","groups",".",":","param","mapped_triples",":","shape",":","(","n",",","3",")","the","ID-based","triples",":","param","random_state",":","the","random","state","used","to","shuffle","and","split","the","triples",":","param","ratios",":","There","are","three","options","for","this","argument",".","First",",","a","float","can","be","given","between","0","and","1.0",",","non-inclusive",".","The","first","set","of","triples","will","get","this","ratio","and","the","second","will","get","the","rest",".","Second",",","a","list","of","ratios","can","be","given","for","which","set","in","which","order","should","get","what","ratios","as","in","``","[","0.8",",","0.1","]","``",".","The","final","ratio","can","be","omitted","because","that","can","be","calculated",".","Third",",","all","ratios","can","be","explicitly","set","in","order","such","as","in","``","[","0.8",",","0.1",",","0.1","]","``","where","the","sum","of","all","ratios","is","1.0.",":","return",":","A","partition","of","triples",",","which","are","split","(","approximately",")","according","to","the","ratios","."]
code: def split(
      self,
      *,
      mapped_triples: MappedTriples,
      ratios: Union[float, Sequence[float]] = 0.8,
      random_state: TorchRandomHint = None,
  ) -> Sequence[MappedTriples]:
      """Split triples into clean groups.
  
      :param mapped_triples: shape: (n, 3)
          the ID-based triples
      :param random_state:
          the random state used to shuffle and split the triples
      :param ratios:
          There are three options for this argument.
          First, a float can be given between 0 and 1.0, non-inclusive. The first set of triples will get this
          ratio and the second will get the rest.
          Second, a list of ratios can be given for which set in which order should get what ratios as
          in ``[0.8, 0.1]``.
          The final ratio can be omitted because that can be calculated.
          Third, all ratios can be explicitly set in order such as in ``[0.8, 0.1, 0.1]`` where the sum of
          all ratios is 1.0.
  
      :return:
          A partition of triples, which are split (approximately) according to the ratios.
      """
      random_state = ensure_torch_random_state(random_state)
      ratios = normalize_ratios(ratios=ratios)
      sizes = get_absolute_split_sizes(
          n_total=mapped_triples.shape[0], ratios=ratios
      )
      triples_groups = self.split_absolute_size(
          mapped_triples=mapped_triples,
          sizes=sizes,
          random_state=random_state,
      )
      for i, (triples, exp_size, exp_ratio) in enumerate(
          zip(triples_groups, sizes, ratios)
      ):
          actual_size = triples.shape[0]
          actual_ratio = actual_size / exp_size * exp_ratio
          if actual_size != exp_size:
              logger.warning(
                  f"Requested ratio[{i}]={exp_ratio:.3f} (equal to size {exp_size}), but got {actual_ratio:.3f} "
                  f"(equal to size {actual_size}) to ensure that all entities/relations occur in train.",
              )
      return triples_groups
  
imports: import logging
  import typing
  from abc import abstractmethod
  from typing import Collection, Optional, Sequence, Set, Tuple, Type, Union
  import numpy
  import pandas
  import torch
  from class_resolver.api import ClassResolver, HintOrType
  from ..constants import COLUMN_LABELS
  from ..typing import LABEL_HEAD, LABEL_RELATION, LABEL_TAIL, MappedTriples, Target, TorchRandomHint
  from ..utils import ensure_torch_random_state
label_desc: Use image node_id 2 for calling the Splitter obj's underlying member method code with example usage: obj.split() and returns: triples_groups