class_docstr: Unit test class for model creation process under various option values and
  types of input data.
class_docstr_tok: ["Unit","test","class","for","model","creation","process","under","various","option","values","and","types","of","input","data","."]
docstr: Test that the features parameter works correctly in each of four
  combinations of 'features' and 'distance' parameters. Specifically, if
  the 'distance' parameter is a composite distance, the specified features
  in that parameter should take precedence.
docstr_tok: ["Test","that","the","features","parameter","works","correctly","in","each","of","four","combinations","of","'features","'","and","'distance","'","parameters",".","Specifically",",","if","the","'distance","'","parameter","is","a","composite","distance",",","the","specified","features","in","that","parameter","should","take","precedence","."]
code: def test_features(self):
      """
      Test that the features parameter works correctly in each of four
      combinations of 'features' and 'distance' parameters. Specifically, if
      the 'distance' parameter is a composite distance, the specified features
      in that parameter should take precedence.
      """
  
      ## Default is to get all features from the SFrame if 'features' is not
      #  specified and if the distance parameter is not a composite distance.
      numeric_features = ["int0", "int1", "float0", "float1", "array0"]
      m = tc.nearest_neighbor_classifier.create(
          self.sf[numeric_features + ["class"]],
          target="class",
          distance="euclidean",
          verbose=False,
      )
      self.assertEqual(m.num_features, 5)
      self.assertItemsEqual(m.features, numeric_features)
  
      ## 'features' parameter applies if custom distance not provided.
      m = tc.nearest_neighbor_classifier.create(
          self.sf,
          target="class",
          features=numeric_features,
          distance="euclidean",
          verbose=False,
      )
      self.assertEqual(m.num_features, 5)
      self.assertItemsEqual(m.features, numeric_features)
  
      ## Composite distance features should override the 'features' parameter.
      m = tc.nearest_neighbor_classifier.create(
          self.sf,
          target="class",
          features=["str0", "dict0"],
          distance=self.distance,
          verbose=False,
      )
      self.assertEqual(m.num_features, 7)
      self.assertItemsEqual(
          m.features,
          [
              "int0",
              "int1",
              "float0",
              "float1",
              "array0",
              "str0",
              "dict0",
          ],
      )
  
      ## Make sure the target is removed from the 'features' parameter.
      m = tc.nearest_neighbor_classifier.create(
          self.sf,
          target="class",
          features=numeric_features + ["class"],
          distance="euclidean",
          verbose=False,
      )
      self.assertEqual(m.num_features, 5)
      self.assertItemsEqual(m.features, numeric_features)
  
      ## Make sure the target is removed from the composite distance features.
      distance = copy.deepcopy(self.distance)
      distance[2][0].append("class")
      m = tc.nearest_neighbor_classifier.create(
          self.sf, target="class", distance=distance, verbose=False
      )
  
      self.assertEqual(m.num_features, 7)
      self.assertItemsEqual(
          m.features,
          [
              "int0",
              "int1",
              "float0",
              "float1",
              "array0",
              "str0",
              "dict0",
          ],
      )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import copy
  import array
  import numpy
  import turicreate
  from .None import util
  from turicreate.util import _assert_sframe_equal
  from turicreate.toolkits._main import ToolkitError
  import sys
label_desc: Use image node_id 5 for calling the KnnClassifierCreateTest obj's underlying member method code with example usage: obj.test_features() without return types