class_docstr: This is the base estimator for gluoncv.auto.Estimators.
  
  Parameters
  ----------
  config : dict
      Config in nested dict.
  logger : logging.Logger
      Optional logger for this estimator, can be `None` when default setting is used.
  reporter : callable
      The reporter for metric checkpointing.
  name : str
      Optional name for the estimator.
  
  Attributes
  ----------
  _logger : logging.Logger
      The customized/default logger for this estimator.
  _logdir : str
      The temporary dir for logs.
  _cfg : autocfg.dataclass
      The configurations.
class_docstr_tok: ["This","is","the","base","estimator","for","gluoncv.auto.Estimators",".","Parameters","--","--","--","--","--","config",":","dict","Config","in","nested","dict",".","logger",":","logging.Logger","Optional","logger","for","this","estimator",",","can","be","`","None","`","when","default","setting","is","used",".","reporter",":","callable","The","reporter","for","metric","checkpointing",".","name",":","str","Optional","name","for","the","estimator",".","Attributes","--","--","--","--","--","_logger",":","logging.Logger","The","customized\/default","logger","for","this","estimator",".","_logdir",":","str","The","temporary","dir","for","logs",".","_cfg",":","autocfg.dataclass","The","configurations","."]
docstr: Fit with train/validation data.
  
  Parameters
  ----------
  train_data : pd.DataFrame or iterator
      Training data.
  val_data : pd.DataFrame or iterator, optional
      Validation data, optional. If `train_data` is DataFrame, `val_data` will be split from
      `train_data` given `train_size`.
  train_size : float
      The portion of train data split from original `train_data` if `val_data` is not provided.
  random_state : int
      Random state for splitting, for `np.random.seed`.
  resume : bool
      Whether resume from previous `fit`(if possible) or start as fresh.
  time_limit : int, default is None
      The wall clock time limit(second) for fit process, if `None`, time limit is not enforced.
      If `fit` takes longer than `time_limit`, the process will terminate early and return the
      model prematurally.
      Due to callbacks and additional validation functions, the `time_limit` may not be very precise
      (few minutes allowance), but you can use it to safe-guard a very long training session.
  
  Returns
  -------
  None
docstr_tok: ["Fit","with","train\/validation","data",".","Parameters","--","--","--","--","--","train_data",":","pd.DataFrame","or","iterator","Training","data",".","val_data",":","pd.DataFrame","or","iterator",",","optional","Validation","data",",","optional",".","If","`","train_data","`","is","DataFrame",",","`","val_data","`","will","be","split","from","`","train_data","`","given","`","train_size","`",".","train_size",":","float","The","portion","of","train","data","split","from","original","`","train_data","`","if","`","val_data","`","is","not","provided",".","random_state",":","int","Random","state","for","splitting",",","for","`","np.random.seed","`",".","resume",":","bool","Whether","resume","from","previous","`","fit","`","(","if","possible",")","or","start","as","fresh",".","time_limit",":","int",",","default","is","None","The","wall","clock","time","limit","(","second",")","for","fit","process",",","if","`","None","`",",","time","limit","is","not","enforced",".","If","`","fit","`","takes","longer","than","`","time_limit","`",",","the","process","will","terminate","early","and","return","the","model","prematurally",".","Due","to","callbacks","and","additional","validation","functions",",","the","`","time_limit","`","may","not","be","very","precise","(","few","minutes","allowance",")",",","but","you","can","use","it","to","safe-guard","a","very","long","training","session",".","Returns","--","--","--","-","None"]
code: def fit(
      self,
      train_data,
      val_data=None,
      train_size=0.9,
      random_state=None,
      resume=False,
      time_limit=None,
  ):
      """Fit with train/validation data.
  
      Parameters
      ----------
      train_data : pd.DataFrame or iterator
          Training data.
      val_data : pd.DataFrame or iterator, optional
          Validation data, optional. If `train_data` is DataFrame, `val_data` will be split from
          `train_data` given `train_size`.
      train_size : float
          The portion of train data split from original `train_data` if `val_data` is not provided.
      random_state : int
          Random state for splitting, for `np.random.seed`.
      resume : bool
          Whether resume from previous `fit`(if possible) or start as fresh.
      time_limit : int, default is None
          The wall clock time limit(second) for fit process, if `None`, time limit is not enforced.
          If `fit` takes longer than `time_limit`, the process will terminate early and return the
          model prematurally.
          Due to callbacks and additional validation functions, the `time_limit` may not be very precise
          (few minutes allowance), but you can use it to safe-guard a very long training session.
  
      Returns
      -------
      None
  
      """
      if time_limit is None:
          time_limit = math.inf
      elif not isinstance(time_limit, (int, float)):
          raise TypeError(
              f"Invalid type `time_limit={time_limit}`, int/float or None expected"
          )
      if not resume:
          self.classes = train_data.classes
          self.num_class = len(self.classes)
          self._init_network()
      if not isinstance(train_data, pd.DataFrame):
          assert (
              val_data is not None
          ), "Please provide `val_data` as we do not know how to split `train_data` of type: \
                  {}".format(
              type(train_data)
          )
          ret = (
              self._fit(train_data, val_data, time_limit=time_limit)
              if not resume
              else self._resume_fit(
                  train_data, val_data, time_limit=time_limit
              )
          )
          return self._reload_best(ret)
  
      os.makedirs(self._logdir, exist_ok=True)
      if val_data is None:
          assert 0 <= train_size <= 1.0
          if random_state:
              np.random.seed(random_state)
          split_mask = np.random.rand(len(train_data)) < train_size
          train = train_data[split_mask]
          val = train_data[~split_mask]
          self._logger.info(
              "Randomly split train_data into train[%d]/validation[%d] splits.",
              len(train),
              len(val),
          )
          ret = (
              self._fit(train, val, time_limit=time_limit)
              if not resume
              else self._resume_fit(train, val, time_limit=time_limit)
          )
          return self._reload_best(ret)
  
      ret = (
          self._fit(train_data, val_data, time_limit=time_limit)
          if not resume
          else self._resume_fit(
              train_data, val_data, time_limit=time_limit
          )
      )
      return self._reload_best(ret)
  
imports: import os
  import math
  import pickle
  import io
  import logging
  from datetime import datetime
  import numpy
  import pandas
  from ...utils import random
  from ...utils.filesystem import temporary_filename
  from .utils import _suggest_load_context
label_desc: Use image node_id 2 for calling the BaseEstimator obj's underlying member method code with example usage: obj.fit(train_data, val_data, train_size, random_state, resume, time_limit) and returns: self, self, self