docstr: The Pytorch Lightning Datamodule for Tabular Data.
  
  Args:
      train (DataFrame): The Training Dataframe
  
      config (DictConfig): Merged configuration object from ModelConfig, DataConfig,
          TrainerConfig, OptimizerConfig & ExperimentConfig
  
      validation (DataFrame, optional): Validation Dataframe.
          If left empty, we use the validation split from DataConfig to split a random sample as validation.
          Defaults to None.
  
      target_transform (Optional[Union[TransformerMixin, Tuple(Callable)]], optional):
          If provided, applies the transform to the target before modelling and inverse the transform during
          prediction. The parameter can either be a sklearn Transformer which has an inverse_transform method, or
          a tuple of callables (transform_func, inverse_transform_func)
          Defaults to None.
  
      train_sampler (Optional[torch.utils.data.Sampler], optional):
          If provided, the sampler will be used to sample the train data. Defaults to None.
  
      seed (Optional[int], optional): Seed to use for reproducible dataloaders. Defaults to 42.
  
      cache_data (str): Decides how to cache the data in the dataloader. If set to
          "memory", will cache in memory. If set to a valid path, will cache in that path. Defaults to "memory".
  
      copy_data (bool): If True, will copy the dataframes before preprocessing. Defaults to True.
  
      verbose (bool): Sets the verbosity of the databodule logging
docstr_tok: ["The","Pytorch","Lightning","Datamodule","for","Tabular","Data",".","Args",":","train","(","DataFrame",")",":","The","Training","Dataframe","config","(","DictConfig",")",":","Merged","configuration","object","from","ModelConfig",",","DataConfig",",","TrainerConfig",",","OptimizerConfig","&","ExperimentConfig","validation","(","DataFrame",",","optional",")",":","Validation","Dataframe",".","If","left","empty",",","we","use","the","validation","split","from","DataConfig","to","split","a","random","sample","as","validation",".","Defaults","to","None",".","target_transform","(","Optional","[","Union","[","TransformerMixin",",","Tuple","(","Callable",")","]","]",",","optional",")",":","If","provided",",","applies","the","transform","to","the","target","before","modelling","and","inverse","the","transform","during","prediction",".","The","parameter","can","either","be","a","sklearn","Transformer","which","has","an","inverse_transform","method",",","or","a","tuple","of","callables","(","transform_func",",","inverse_transform_func",")","Defaults","to","None",".","train_sampler","(","Optional","[","torch.utils.data.Sampler","]",",","optional",")",":","If","provided",",","the","sampler","will","be","used","to","sample","the","train","data",".","Defaults","to","None",".","seed","(","Optional","[","int","]",",","optional",")",":","Seed","to","use","for","reproducible","dataloaders",".","Defaults","to","42.","cache_data","(","str",")",":","Decides","how","to","cache","the","data","in","the","dataloader",".","If","set","to","``","memory","''",",","will","cache","in","memory",".","If","set","to","a","valid","path",",","will","cache","in","that","path",".","Defaults","to","``","memory","''",".","copy_data","(","bool",")",":","If","True",",","will","copy","the","dataframes","before","preprocessing",".","Defaults","to","True",".","verbose","(","bool",")",":","Sets","the","verbosity","of","the","databodule","logging"]
code: def __init__(
      self,
      train: DataFrame,
      config: DictConfig,
      validation: DataFrame = None,
      target_transform: Optional[Union[TransformerMixin, Tuple]] = None,
      train_sampler: Optional[torch.utils.data.Sampler] = None,
      seed: Optional[int] = 42,
      cache_data: str = "memory",
      copy_data: bool = True,
      verbose: bool = True,
  ):
      """The Pytorch Lightning Datamodule for Tabular Data.
  
      Args:
          train (DataFrame): The Training Dataframe
  
          config (DictConfig): Merged configuration object from ModelConfig, DataConfig,
              TrainerConfig, OptimizerConfig & ExperimentConfig
  
          validation (DataFrame, optional): Validation Dataframe.
              If left empty, we use the validation split from DataConfig to split a random sample as validation.
              Defaults to None.
  
          target_transform (Optional[Union[TransformerMixin, Tuple(Callable)]], optional):
              If provided, applies the transform to the target before modelling and inverse the transform during
              prediction. The parameter can either be a sklearn Transformer which has an inverse_transform method, or
              a tuple of callables (transform_func, inverse_transform_func)
              Defaults to None.
  
          train_sampler (Optional[torch.utils.data.Sampler], optional):
              If provided, the sampler will be used to sample the train data. Defaults to None.
  
          seed (Optional[int], optional): Seed to use for reproducible dataloaders. Defaults to 42.
  
          cache_data (str): Decides how to cache the data in the dataloader. If set to
              "memory", will cache in memory. If set to a valid path, will cache in that path. Defaults to "memory".
  
          copy_data (bool): If True, will copy the dataframes before preprocessing. Defaults to True.
  
          verbose (bool): Sets the verbosity of the databodule logging
      """
      super().__init__()
      self.train = train.copy() if copy_data else train
      if validation is not None:
          self.validation = (
              validation.copy() if copy_data else validation
          )
      else:
          self.validation = None
      self._set_target_transform(target_transform)
      self.target = config.target or []
      self.batch_size = config.batch_size
      self.train_sampler = train_sampler
      self.config = config
      self.seed = seed
      self.verbose = verbose
      self._fitted = False
      self._setup_cache(cache_data)
      self._inferred_config = self._update_config(config)
  
imports: import re
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  import joblib
  import numpy
  import pandas
  import pytorch_lightning
  import torch
  from omegaconf import DictConfig
  from pandas import DataFrame, DatetimeTZDtype, to_datetime
  from pandas.tseries import offsets
  from pandas.tseries.frequencies import to_offset
  from sklearn.base import TransformerMixin, copy
  from sklearn.preprocessing import FunctionTransformer, LabelEncoder, PowerTransformer, QuantileTransformer, StandardScaler
  from torch.utils.data import DataLoader, Dataset
  from pytorch_tabular.config import InferredConfig
  from pytorch_tabular.utils import get_logger
  from .categorical_encoders import OrdinalEncoder
label_desc: Use image node_id 1 to create a new TabularDatamodule object from inherited base classes: pl with example: obj = TabularDatamodule(train, config, validation, target_transform, train_sampler, seed, cache_data, copy_data, verbose)