code: def binary_classification_integer_target(cls):
      """
      Binary classification with an integer target.
      """
      # Get the data from the mushroom dataset.
      cls.data = tc.SFrame.read_csv(mushroom_dataset)
      cls.dtrain, cls.dtest = cls.data.random_split(0.8, seed=1)
      cls.dtrain["label"] = cls.dtrain["label"] == "p"
      cls.dtest["label"] = cls.dtest["label"] == "p"
      cls.param = {
          "max_depth": 3,
          "step_size": 1,
          "min_loss_reduction": 1,
          "max_iterations": 2,
          "min_child_weight": 1,
      }
      cls.target = "label"
      cls.unpacked_features = cls.data.column_names()
      cls.unpacked_features.remove(cls.target)
      cls.features = cls.unpacked_features[:]
      cls.model = tc.boosted_trees_classifier.create(
          cls.dtrain,
          target=cls.target,
          validation_set=cls.dtest,
          **cls.param,
      )
  
      cls.def_opts = copy.deepcopy(_DEFAULT_OPTIONS_CLASSIFIER)
      cls.opts = cls.def_opts.copy()
      cls.opts.update(cls.param)
      cls.type = int
  
      # Answers
      # ------------------------------------------------------------------------
      if "classes" in cls.model._list_fields():
          num_examples_per_class = {
              c: (cls.dtrain[cls.target] == c).sum()
              for c in cls.model.classes
          }
      cls.get_ans = {
          "column_subsample": lambda x: cls.opts["column_subsample"],
          "unpacked_features": lambda x: x == cls.unpacked_features,
          "features": lambda x: x == cls.features,
          "max_depth": lambda x: x == cls.opts["max_depth"],
          "min_child_weight": lambda x: x
          == cls.opts["min_child_weight"],
          "min_loss_reduction": lambda x: x
          == cls.opts["min_loss_reduction"],
          "num_examples": lambda x: x == cls.dtrain.num_rows(),
          "num_examples_per_class": lambda x: x
          == num_examples_per_class,
          "num_classes": lambda x: x == 2,
          "classes": lambda x: x == [0, 1],
          "num_unpacked_features": lambda x: x == 22,
          "num_features": lambda x: x == 22,
          "max_iterations": lambda x: x == cls.opts["max_iterations"],
          "num_trees": lambda x: x == cls.opts["max_iterations"],
          "num_validation_examples": lambda x: x
          == cls.dtest.num_rows(),
          "row_subsample": lambda x: x == cls.opts["row_subsample"],
          "step_size": lambda x: x == cls.opts["step_size"],
          "target": lambda x: x == cls.target,
          "training_accuracy": lambda x: x > 0,
          "training_log_loss": lambda x: x > 0,
          "training_time": lambda x: x >= 0,
          "class_weights": lambda x: x == {0: 1.0, 1: 1.0},
          "trees_json": lambda x: isinstance(x, list),
          "validation_accuracy": lambda x: x > 0,
          "validation_log_loss": lambda x: x > 0,
          "random_seed": lambda x: x is None,
          "progress": lambda x: isinstance(x, tc.SFrame) or (x is None),
          "metric": lambda x: x == "auto",
          "early_stopping_rounds": lambda x: x is None,
          "model_checkpoint_interval": lambda x: x == 5,
          "model_checkpoint_path": lambda x: x is None,
          "resume_from_checkpoint": lambda x: x is None,
          "training_auc": lambda x: x > 0,
          "training_confusion_matrix": lambda x: len(x) > 0,
          "training_f1_score": lambda x: x > 0,
          "training_precision": lambda x: x > 0,
          "training_recall": lambda x: x > 0,
          "training_report_by_class": lambda x: len(x) > 0,
          "training_roc_curve": lambda x: len(x) > 0,
          "validation_data": lambda x: isinstance(x, tc.SFrame)
          and len(x) == len(cls.dtest),
          "validation_auc": lambda x: x > 0,
          "validation_confusion_matrix": lambda x: len(x) > 0,
          "validation_f1_score": lambda x: x > 0,
          "validation_precision": lambda x: x > 0,
          "validation_recall": lambda x: x > 0,
          "validation_report_by_class": lambda x: len(x) > 0,
          "validation_roc_curve": lambda x: len(x) > 0,
          "disable_posttrain_evaluation": lambda x: x == False,
      }
      cls.fields_ans = cls.get_ans.keys()
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import turicreate
  import uuid
  import random
  import copy
  from turicreate.toolkits._main import ToolkitError
  import turicreate.toolkits.evaluation
  import shutil
  from array import array
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: binary_classification_integer_target(cls) without return types