class_docstr: Object which carries out genetic search and returns top performing model
  upon completion.
docstr: Set the metric for optimization. Can also be done by passing to
  `run`.
  
  Args:
      metric (str): either 'acc' to maximize classification accuracy, or
              else 'loss' to minimize the loss function
docstr_tok: ["Set","the","metric","for","optimization",".","Can","also","be","done","by","passing","to","`","run","`",".","Args",":","metric","(","str",")",":","either","'acc","'","to","maximize","classification","accuracy",",","or","else","'loss","'","to","minimize","the","loss","function"]
code: def set_objective(self, metric):
      """
      Set the metric for optimization. Can also be done by passing to
      `run`.
  
      Args:
          metric (str): either 'acc' to maximize classification accuracy, or
                  else 'loss' to minimize the loss function
      """
      if metric == "acc":
          metric = "accuracy"
      if metric not in ["loss", "accuracy"]:
          raise ValueError(
              (
                  "Invalid metric name {} provided - should be"
                  '"accuracy" or "loss"'
              ).format(metric)
          )
      self._metric = metric
      self._objective = "max" if self._metric == "accuracy" else "min"
      self._metric_index = 1 if self._metric == "loss" else -1
      self._metric_op = METRIC_OPS[self._objective == "max"]
      self._metric_objective = METRIC_OBJECTIVES[
          self._objective == "max"
      ]
  
imports: from __future__ import print_function
  import random
  import csv
  import operator
  import gc
  import os
  from datetime import datetime
  from keras.callbacks import EarlyStopping
  from keras.models import load_model
  import keras.backend
  from sklearn.metrics import log_loss
  import numpy
label_desc: Use image node_id 2 for calling the DEvol obj's underlying member method code with example usage: obj.set_objective(metric) without return types