docstr: Given a set of fully-qualified hyperparameters, create and test a
  classifier model.
  Returns: Model object and metrics dictionary
docstr_tok: ["Given","a","set","of","fully-qualified","hyperparameters",",","create","and","test","a","classifier","model",".","Returns",":","Model","object","and","metrics","dictionary"]
code: def test_classifier(self, method, params):
      """
      Given a set of fully-qualified hyperparameters, create and test a
      classifier model.
      Returns: Model object and metrics dictionary
      """
      model = Model(
          method=method,
          params=params,
          judgment_metric=self.datarun.metric,
          class_column=self.dataset.class_column,
          verbose_metrics=self.verbose_metrics,
      )
  
      train_path, test_path = self.dataset.load()
  
      metrics = model.train_test(self.dataset)
  
      target = self.datarun.score_target
  
      def metric_string(model):
          if "cv" in target or "mu_sigma" in target:
              return "%.3f +- %.3f" % (
                  model.cv_judgment_metric,
                  2 * model.cv_judgment_metric_stdev,
              )
          else:
              return "%.3f" % model.test_judgment_metric
  
      LOGGER.info(
          "Judgment metric (%s, %s): %s"
          % (
              self.datarun.metric,
              target[: -len("_judgment_metric")],
              metric_string(model),
          )
      )
  
      old_best = self.db.get_best_classifier(
          datarun_id=self.datarun.id, score_target=target
      )
      if old_best is not None:
          if getattr(model, target) > getattr(old_best, target):
              LOGGER.info(
                  "New best score! Previous best (classifier %s): %s",
                  old_best.id,
                  metric_string(old_best),
              )
          else:
              LOGGER.info(
                  "Best so far (classifier %s): %s",
                  old_best.id,
                  metric_string(old_best),
              )
  
      return model, metrics
  
imports: from __future__ import absolute_import, unicode_literals
  import datetime
  import imp
  import logging
  import os
  import re
  import socket
  import traceback
  import warnings
  from builtins import object, str
  from collections import defaultdict
  import boto3
  import numpy
  from atm.classifier import Model
  from atm.constants import CUSTOM_CLASS_REGEX, SELECTORS, TUNERS
  from atm.database import ClassifierStatus, DBSession
  from atm.utilities import ensure_directory, get_instance, save_metrics, save_model, update_params
label_desc: Use image node_id 6 for calling the Worker obj's underlying member method code with example usage: obj.test_classifier(method, params) and returns: model,  metrics, unknown, unknown