class_docstr: PyTorch neural network models for classification/regression with tabular data.
class_docstr_tok: ["PyTorch","neural","network","models","for","classification\/regression","with","tabular","data","."]
code: def _process_train_data(
      self,
      df,
      impute_strategy,
      max_category_levels,
      skew_threshold,
      embed_min_categories,
      use_ngram_features,
      labels,
  ):
      from .tabular_torch_dataset import TabularTorchDataset
  
      # sklearn processing n_quantiles warning
      warnings.filterwarnings("ignore", module="sklearn.preprocessing")
      if labels is None:
          raise ValueError(
              "Attempting process training data without labels"
          )
      if len(labels) != len(df):
          raise ValueError(
              "Number of examples in Dataframe does not match number of labels"
          )
  
      # dict with keys: : 'continuous', 'skewed', 'onehot', 'embed', values = column-names of df
      self._types_of_features, df = self._get_types_of_features(
          df,
          skew_threshold=skew_threshold,
          embed_min_categories=embed_min_categories,
          use_ngram_features=use_ngram_features,
      )
      logger.log(
          15,
          "Tabular Neural Network treats features as the following types:",
      )
      logger.log(15, json.dumps(self._types_of_features, indent=4))
      logger.log(15, "\n")
      if self.processor is not None:
          Warning(
              f"Attempting to process training data for {self.__class__.__name__}, but previously already did this."
          )
      self.processor = create_preprocessor(
          impute_strategy=impute_strategy,
          max_category_levels=max_category_levels,
          unique_category_str=self.unique_category_str,
          continuous_features=self._types_of_features["continuous"],
          skewed_features=self._types_of_features["skewed"],
          onehot_features=self._types_of_features["onehot"],
          embed_features=self._types_of_features["embed"],
          bool_features=self._types_of_features["bool"],
      )
      df = self.processor.fit_transform(df)
      # OrderedDict of feature-name -> list of column-indices in df corresponding to this feature
      self.feature_arraycol_map = get_feature_arraycol_map(
          processor=self.processor,
          max_category_levels=max_category_levels,
      )
      num_array_cols = np.sum(
          [
              len(self.feature_arraycol_map[key])
              for key in self.feature_arraycol_map
          ]
      )  # should match number of columns in processed array
      if num_array_cols != df.shape[1]:
          raise ValueError(
              "Error during one-hot encoding data processing for neural network. "
              "Number of columns in df array does not match feature_arraycol_map."
          )
  
      # OrderedDict of feature-name -> feature_type string (options: 'vector', 'embed')
      self.feature_type_map = get_feature_type_map(
          feature_arraycol_map=self.feature_arraycol_map,
          types_of_features=self._types_of_features,
      )
      return TabularTorchDataset(
          df,
          self.feature_arraycol_map,
          self.feature_type_map,
          self.problem_type,
          labels,
      )
  
imports: import json
  import logging
  import os
  import random
  import time
  import warnings
  from typing import Dict, Union
  import numpy
  import pandas
  from autogluon.common.features.types import R_BOOL, R_CATEGORY, R_FLOAT, R_INT, S_TEXT_AS_CATEGORY, S_TEXT_NGRAM
  from autogluon.common.utils.pandas_utils import get_approximate_df_mem_usage
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.common.utils.try_import import try_import_torch
  from autogluon.core.constants import BINARY, MULTICLASS, QUANTILE, REGRESSION, SOFTCLASS
  from autogluon.core.hpo.constants import RAY_BACKEND
  from autogluon.core.models.abstract.abstract_nn_model import AbstractNeuralNetworkModel
  from autogluon.core.utils.exceptions import TimeLimitExceeded
  from ..compilers.native import TabularNeuralNetTorchNativeCompiler
  from ..compilers.onnx import TabularNeuralNetTorchOnnxCompiler
  from ..hyperparameters.parameters import get_default_param
  from ..hyperparameters.searchspaces import get_default_searchspace
  from ..utils.data_preprocessor import create_preprocessor, get_feature_arraycol_map, get_feature_type_map
  from ..utils.nn_architecture_utils import infer_y_range
label_desc: Use image node_id 17 for calling the TabularNeuralNetTorchModel obj's underlying member method code with example usage: obj._process_train_data(df, impute_strategy, max_category_levels, skew_threshold, embed_min_categories, use_ngram_features, labels) and returns: TabularTorchDataset