class_docstr: Represents dataset with associated metadata.
  
  Holds all information about one split of a dataset (e.g. training set).
  
  Attributes:
      fields (dict): A mapping from attribute names (e.g. "left_address") to
          corresponding :class:`~data.MatchingField` objects that specify how to process
          the field.
      examples (list): A list containing all the examples (labeled tuple pairs) in this
          dataset.
      metadata (dict): Metadata about the dataset (e.g. word probabilities).
          See :meth:`~data.MatchingDataset.compute_metadata` for details.
      corresponding_field (dict): A mapping from left table attribute names
          (e.g. "left_address") to corresponding right table attribute names
          (e.g. "right_address") and vice versa.
      text_fields (dict): A mapping from canonical attribute names (e.g. "address") to
          tuples of the corresponding left and right attribute names
          (e.g. ("left_address", "right_address")).
      all_left_fields (list): A list of all left table attribute names.
      all_right_fields (list): A list of all right table attribute names.
      canonical_text_fields (list): A list of all canonical attribute names.
      label_field (str): Name of the column containing labels.
      id_field (str): Name of the column containing tuple pair ids.
class_docstr_tok: ["Represents","dataset","with","associated","metadata",".","Holds","all","information","about","one","split","of","a","dataset","(","e.g",".","training","set",")",".","Attributes",":","fields","(","dict",")",":","A","mapping","from","attribute","names","(","e.g",".","``","left_address","''",")","to","corresponding",":","class",":","`","~data.MatchingField","`","objects","that","specify","how","to","process","the","field",".","examples","(","list",")",":","A","list","containing","all","the","examples","(","labeled","tuple","pairs",")","in","this","dataset",".","metadata","(","dict",")",":","Metadata","about","the","dataset","(","e.g",".","word","probabilities",")",".","See",":","meth",":","`","~data.MatchingDataset.compute_metadata","`","for","details",".","corresponding_field","(","dict",")",":","A","mapping","from","left","table","attribute","names","(","e.g",".","``","left_address","''",")","to","corresponding","right","table","attribute","names","(","e.g",".","``","right_address","''",")","and","vice","versa",".","text_fields","(","dict",")",":","A","mapping","from","canonical","attribute","names","(","e.g",".","``","address","''",")","to","tuples","of","the","corresponding","left","and","right","attribute","names","(","e.g",".","(","``","left_address","''",",","``","right_address","''",")",")",".","all_left_fields","(","list",")",":","A","list","of","all","left","table","attribute","names",".","all_right_fields","(","list",")",":","A","list","of","all","right","table","attribute","names",".","canonical_text_fields","(","list",")",":","A","list","of","all","canonical","attribute","names",".","label_field","(","str",")",":","Name","of","the","column","containing","labels",".","id_field","(","str",")",":","Name","of","the","column","containing","tuple","pair","ids","."]
docstr: Create Dataset objects for multiple splits of a dataset.
  
  Args:
      path (str): Common prefix of the splits' file paths.
      train (str): Suffix to add to path for the train set.
      validation (str): Suffix to add to path for the validation set, or None
          for no validation set. Default is None.
      test (str): Suffix to add to path for the test set, or None for no test
          set. Default is None.
      fields (list(tuple(str, MatchingField))): A list of tuples containing column
          name (e.g. "left_address") and corresponding :class:`~data.MatchingField`
          pairs, in the same order that the columns occur in the CSV file. Tuples of
          (name, None) represent columns that will be ignored.
      embeddings (str or list): Same as `embeddings` parameter of
          :func:`~data.process`.
      embeddings_cache (str): Directory to store dowloaded word vector data.
      column_naming (dict): Same as `column_naming` paramter of `__init__`.
      cache (str): Suffix to add to path for cache file. If `None` disables caching.
      check_cached_data (bool): Verify that data files haven't changes since the
          cache was constructed and that relevant field options haven't changed.
      auto_rebuild_cache (bool): Automatically rebuild the cache if the data files
          are modified or if the field options change. Defaults to False.
      train_pca (bool): Whether to compute PCA for each attribute as part of
          dataset metadata compuatation. Defaults to False.
      filter_pred (callable or None): Use only examples for which
          filter_pred(example) is True, or use all examples if None.
          Default is None. This is a keyword-only parameter.
  
  Returns:
      Tuple[MatchingDataset]: Datasets for (train, validation, and test) splits in
          that order, if provided.
docstr_tok: ["Create","Dataset","objects","for","multiple","splits","of","a","dataset",".","Args",":","path","(","str",")",":","Common","prefix","of","the","splits","'","file","paths",".","train","(","str",")",":","Suffix","to","add","to","path","for","the","train","set",".","validation","(","str",")",":","Suffix","to","add","to","path","for","the","validation","set",",","or","None","for","no","validation","set",".","Default","is","None",".","test","(","str",")",":","Suffix","to","add","to","path","for","the","test","set",",","or","None","for","no","test","set",".","Default","is","None",".","fields","(","list","(","tuple","(","str",",","MatchingField",")",")",")",":","A","list","of","tuples","containing","column","name","(","e.g",".","``","left_address","''",")","and","corresponding",":","class",":","`","~data.MatchingField","`","pairs",",","in","the","same","order","that","the","columns","occur","in","the","CSV","file",".","Tuples","of","(","name",",","None",")","represent","columns","that","will","be","ignored",".","embeddings","(","str","or","list",")",":","Same","as","`","embeddings","`","parameter","of",":","func",":","`","~data.process","`",".","embeddings_cache","(","str",")",":","Directory","to","store","dowloaded","word","vector","data",".","column_naming","(","dict",")",":","Same","as","`","column_naming","`","paramter","of","`","__init__","`",".","cache","(","str",")",":","Suffix","to","add","to","path","for","cache","file",".","If","`","None","`","disables","caching",".","check_cached_data","(","bool",")",":","Verify","that","data","files","have","n't","changes","since","the","cache","was","constructed","and","that","relevant","field","options","have","n't","changed",".","auto_rebuild_cache","(","bool",")",":","Automatically","rebuild","the","cache","if","the","data","files","are","modified","or","if","the","field","options","change",".","Defaults","to","False",".","train_pca","(","bool",")",":","Whether","to","compute","PCA","for","each","attribute","as","part","of","dataset","metadata","compuatation",".","Defaults","to","False",".","filter_pred","(","callable","or","None",")",":","Use","only","examples","for","which","filter_pred","(","example",")","is","True",",","or","use","all","examples","if","None",".","Default","is","None",".","This","is","a","keyword-only","parameter",".","Returns",":","Tuple","[","MatchingDataset","]",":","Datasets","for","(","train",",","validation",",","and","test",")","splits","in","that","order",",","if","provided","."]
code: def splits(
      cls,
      path,
      train=None,
      validation=None,
      test=None,
      fields=None,
      embeddings=None,
      embeddings_cache=None,
      column_naming=None,
      cache=None,
      check_cached_data=True,
      auto_rebuild_cache=False,
      train_pca=False,
      **kwargs,
  ):
      r"""Create Dataset objects for multiple splits of a dataset.
  
      Args:
          path (str): Common prefix of the splits' file paths.
          train (str): Suffix to add to path for the train set.
          validation (str): Suffix to add to path for the validation set, or None
              for no validation set. Default is None.
          test (str): Suffix to add to path for the test set, or None for no test
              set. Default is None.
          fields (list(tuple(str, MatchingField))): A list of tuples containing column
              name (e.g. "left_address") and corresponding :class:`~data.MatchingField`
              pairs, in the same order that the columns occur in the CSV file. Tuples of
              (name, None) represent columns that will be ignored.
          embeddings (str or list): Same as `embeddings` parameter of
              :func:`~data.process`.
          embeddings_cache (str): Directory to store dowloaded word vector data.
          column_naming (dict): Same as `column_naming` paramter of `__init__`.
          cache (str): Suffix to add to path for cache file. If `None` disables caching.
          check_cached_data (bool): Verify that data files haven't changes since the
              cache was constructed and that relevant field options haven't changed.
          auto_rebuild_cache (bool): Automatically rebuild the cache if the data files
              are modified or if the field options change. Defaults to False.
          train_pca (bool): Whether to compute PCA for each attribute as part of
              dataset metadata compuatation. Defaults to False.
          filter_pred (callable or None): Use only examples for which
              filter_pred(example) is True, or use all examples if None.
              Default is None. This is a keyword-only parameter.
  
      Returns:
          Tuple[MatchingDataset]: Datasets for (train, validation, and test) splits in
              that order, if provided.
      """
  
      fields_dict = dict(fields)
      state_args = {"train_pca": train_pca}
  
      datasets = None
      if cache:
          datafiles = list(
              f for f in (train, validation, test) if f is not None
          )
          datafiles = [
              os.path.expanduser(os.path.join(path, d))
              for d in datafiles
          ]
          cachefile = os.path.expanduser(os.path.join(path, cache))
          try:
              (
                  cached_data,
                  cache_stale_cause,
              ) = MatchingDataset.load_cache(
                  fields_dict,
                  datafiles,
                  cachefile,
                  column_naming,
                  state_args,
              )
  
              if check_cached_data and cache_stale_cause:
                  if not auto_rebuild_cache:
                      raise MatchingDataset.CacheStaleException(
                          cache_stale_cause
                      )
                  else:
                      logger.warning(
                          "Rebuilding data cache because: %s",
                          list(cache_stale_cause),
                      )
  
              if not check_cached_data or not cache_stale_cause:
                  datasets = MatchingDataset.restore_data(
                      fields, cached_data
                  )
  
          except IOError:
              pass
  
      if not datasets:
          begin = timer()
          dataset_args = {
              "fields": fields,
              "column_naming": column_naming,
              **kwargs,
          }
          train_data = (
              None
              if train is None
              else cls(path=os.path.join(path, train), **dataset_args)
          )
          val_data = (
              None
              if validation is None
              else cls(
                  path=os.path.join(path, validation), **dataset_args
              )
          )
          test_data = (
              None
              if test is None
              else cls(path=os.path.join(path, test), **dataset_args)
          )
          datasets = tuple(
              d
              for d in (train_data, val_data, test_data)
              if d is not None
          )
  
          after_load = timer()
          logger.info("Data load took: {}s".format(after_load - begin))
  
          fields_set = set(fields_dict.values())
          for field in fields_set:
              if field is not None and field.use_vocab:
                  field.build_vocab(
                      *datasets,
                      vectors=embeddings,
                      cache=embeddings_cache,
                  )
          after_vocab = timer()
          logger.info(
              "Vocab construction time: {}s".format(
                  after_vocab - after_load
              )
          )
  
          if train:
              datasets[0].compute_metadata(train_pca)
          after_metadata = timer()
          logger.info(
              "Metadata computation time: {}s".format(
                  after_metadata - after_vocab
              )
          )
  
          if cache:
              MatchingDataset.save_cache(
                  datasets,
                  fields_dict,
                  datafiles,
                  cachefile,
                  column_naming,
                  state_args,
              )
              after_cache = timer()
              logger.info(
                  "Cache save time: {}s".format(
                      after_cache - after_vocab
                  )
              )
  
      if train:
          datasets[0].finalize_metadata()
  
          # Save additional information to train dataset.
          datasets[0].embeddings = embeddings
          datasets[0].embeddings_cache = embeddings_cache
          datasets[0].train_pca = train_pca
  
      # Set vocabs.
      for dataset in datasets:
          dataset.vocabs = {
              name: datasets[0].fields[name].vocab
              for name in datasets[0].all_text_fields
          }
  
      if len(datasets) == 1:
          return datasets[0]
      return tuple(datasets)
  
imports: from __future__ import division
  import copy
  import logging
  import os
  import pdb
  from collections import Counter, defaultdict
  from timeit import default_timer
  import pandas
  import pyprind
  import six
  from sklearn.decomposition import TruncatedSVD
  import torch
  import torch.nn
  from torchtext.legacy import data
  from torchtext.legacy.data.example import Example
  from torchtext.utils import unicode_csv_reader
  from ..models.modules import NoMeta, Pool
  from .field import MatchingField
  from .iterator import MatchingIterator
label_desc: Use image node_id 11 for calling the MatchingDataset obj's underlying member method code with example usage: obj.splits(cls, path, train, validation, test, fields, embeddings, embeddings_cache, column_naming, cache, check_cached_data, auto_rebuild_cache, train_pca) and returns: tuple, datasets