code: def _prepare_for_training(self, records, mini_batch_size=None, job_name=None):
          
          super(AmazonAlgorithmEstimatorBase, self)._prepare_for_training(job_name=job_name)
  
          feature_dim = None
  
          if isinstance(records, list):
              for record in records:
                  if record.channel == 'train':
                      feature_dim = record.feature_dim
                      break
              if feature_dim is None:
                  raise ValueError('Must provide train channel.')
          else:
              feature_dim = records.feature_dim
  
          self.feature_dim = feature_dim
          self.mini_batch_size = mini_batch_size
docs: Set hyperparameters needed for training.
  
          Args:
              * records (:class:`~RecordSet`): The records to train this ``Estimator`` on.
              * mini_batch_size (int or None): The size of each mini-batch to use when training. If ``None``, a
                  default value will be used.
              * job_name (str): Name of the training job to be created. If not specified, one is generated,
                  using the base name given to the constructor if applicable.