class_docstr: Example:
      >>> auto_est = AutoEstimator.from_torch(model_creator=model_creator,
                                              optimizer=get_optimizer,
                                              loss=nn.BCELoss(),
                                              logs_dir="/tmp/zoo_automl_logs",
                                              resources_per_trial={"cpu": 2},
                                              name="test_fit")
      >>> auto_est.fit(data=data,
                       validation_data=validation_data,
                       search_space=create_linear_search_space(),
                       n_sampling=4,
                       epochs=1,
                       metric="accuracy")
      >>> best_model = auto_est.get_best_model()
code: def _validate_metric_mode(metric, mode):
      if not mode:
          if callable(metric):
              raise ValueError(
                  "You must specify `metric_mode` for your metric function"
              )
          try:
              from zoo.orca.automl.metrics import Evaluator
  
              mode = Evaluator.get_metric_mode(metric)
          except ValueError:
              pass
          if not mode:
              raise ValueError(
                  f"We cannot infer metric mode with metric name of {metric}. Please"
                  f" specify the `metric_mode` parameter in AutoEstimator.fit()."
              )
      if mode not in ["min", "max"]:
          raise ValueError("`mode` has to be one of ['min', 'max']")
      return mode
  
file_path: analytics-zoo/pyzoo/zoo/orca/automl/auto_estimator.py
imports: from zoo.orca.automl.search import SearchEngineFactory
label_desc: Use image node_id 8 for calling the AutoEstimator obj's underlying member method code with example usage: obj._validate_metric_mode(metric, mode) and returns: mode