class_docstr: The MLP surrogate predicts a model's performance on a new dataset using an
  MLP.
  
  The MLP converts inputs into feature vectors of the same size and uses
  either ranking or regression to predict metrics.
code: def _fit(
      self, X: List[Config[ModelConfig]], y: npt.NDArray[np.float32]
  ) -> None:
      # Fit transformers to infer dimensionality
      X_numpy = self.config_transformer.fit_transform(X)
  
      input_dim = len(self.config_transformer.feature_names_)
      output_dim = y.shape[1]
  
      # For initializing data, we prepare group IDs for the datasets
      mapping = {d: i for i, d in enumerate({x.dataset for x in X})}
  
      # For each output variable, we need to train a separate model
      self.models_ = []
      for i in range(output_dim):
          model = self._init_model(input_dim)
          module = MLPLightningModule(
              model, self.loss, self.weight_decay
          )
  
          # Train on output variable i
          dataset = TensorDataset(
              torch.from_numpy(X_numpy).float(),
              torch.from_numpy(y[:, i : i + 1]).float(),
              torch.as_tensor(
                  [mapping[x.dataset] for x in X], dtype=torch.long
              ),
          )
          train_loader = DataLoader(dataset, batch_size=len(dataset))
          self._trainer.fit(module, train_dataloaders=train_loader)
  
          # Add to models
          self.models_.append(model)
  
imports: from typing import cast, List, Literal, Optional
  import numpy
  import numpy.typing
  import pytorch_lightning
  import torch
  from lightkit.data import DataLoader
  from torch import nn
  from torch.utils.data import TensorDataset
  from tsbench.config import Config, ModelConfig
  from tsbench.evaluations.tracking import ModelTracker
  from ._base import DatasetFeaturesMixin, OutputNormalization, Surrogate
  from ._factory import register_surrogate
  from .torch import ListMLELoss, MLPLightningModule
  from .transformers import ConfigTransformer
label_desc: Use image node_id 3 for calling the MLPSurrogate obj's underlying member method code with example usage: obj._fit(X, y) without return types