class_docstr: Unit test class for correctness of model predictions.
class_docstr_tok: ["Unit","test","class","for","correctness","of","model","predictions","."]
docstr: Unit test for bogus parameters in model prediction methods.
docstr_tok: ["Unit","test","for","bogus","parameters","in","model","prediction","methods","."]
code: def test_bogus_parameters(self):
      """
      Unit test for bogus parameters in model prediction methods.
      """
  
      ## Bogus maximum number of neighbors in each query
      for k in [-1, 0, "fossa"]:
          with self.assertRaises(ValueError):
              ystar = self.model.predict(self.sf, max_neighbors=k)
  
          with self.assertRaises(ValueError):
              ystar = self.model.classify(self.sf, max_neighbors=k)
  
          with self.assertRaises(ValueError):
              ystar = self.model.predict_topk(self.sf, max_neighbors=k)
  
      ## Bogus neighborhood radius
      for r in [-1, "cat"]:
          with self.assertRaises(ValueError):
              ystar = self.model.predict(self.sf, radius=r)
  
          with self.assertRaises(ValueError):
              ystar = self.model.classify(self.sf, radius=r)
  
          with self.assertRaises(ValueError):
              ystar = self.model.predict_topk(self.sf, radius=r)
  
      ## Bogus number of results to return (for predict_topk only)
      for k in [-1, 0, "fossa"]:
          with self.assertRaises(TypeError):
              ystar = self.model.predict_topk(self.sf, k=k)
  
      ## Empty prediction dataset
      with self.assertRaises(ToolkitError):
          ystar = self.model.predict(tc.SFrame())
  
      with self.assertRaises(ToolkitError):
          ystar = self.model.classify(tc.SFrame())
  
      with self.assertRaises(ToolkitError):
          ystar = self.model.predict_topk(tc.SFrame())
  
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 2 for calling the KnnClassifierPredictTest obj's underlying member method code with example usage: obj.test_bogus_parameters() without return types