code: def __init__(self, root: str, train: bool = True):
      filename = "train.csv" if train else "eval.csv"
      if not os.path.exists(os.path.join(root, filename)):
          download_url(
              os.path.join(
                  "https://storage.googleapis.com/tf-datasets/titanic/",
                  filename,
              ),
              root,
              filename,
          )
  
      df = pd.read_csv(os.path.join(root, filename))
      object_colunmns = df.select_dtypes(
          include="object"
      ).columns.values
      for idx in df.columns:
          if idx in object_colunmns:
              df[idx] = LabelEncoder().fit_transform(df[idx])
  
      self.x = df.iloc[:, 1:].values
      self.y = df.iloc[:, 0].values
  
file_path: nni/examples/nas/legacy/notebooks/utils.py
imports: import os
  import torch
  import pandas
  from sklearn.preprocessing import LabelEncoder
  from torchvision.datasets.utils import download_url
label_desc: Use image node_id 1 to create a new TitanicDataset object from inherited base classes: torch.utils.data with example: obj = TitanicDataset(root, train)