class_docstr: K-means clustering model. A k-means model object contains the results of
  running kmeans clustering on a dataset.  Queryable fields include a cluster
  id for each vertex, as well as the centers of the clusters.
  
  This model cannot be constructed directly.  Instead, use
  :func:`turicreate.kmeans.create` to create an instance of this model. A
  detailed list of parameter options and code samples are available in the
  documentation for the create function.
class_docstr_tok: ["K-means","clustering","model",".","A","k-means","model","object","contains","the","results","of","running","kmeans","clustering","on","a","dataset",".","Queryable","fields","include","a","cluster","id","for","each","vertex",",","as","well","as","the","centers","of","the","clusters",".","This","model","can","not","be","constructed","directly",".","Instead",",","use",":","func",":","`","turicreate.kmeans.create","`","to","create","an","instance","of","this","model",".","A","detailed","list","of","parameter","options","and","code","samples","are","available","in","the","documentation","for","the","create","function","."]
docstr: Return predicted cluster label for instances in the new 'dataset'.
  K-means predictions are made by assigning each new instance to the
  closest cluster center.
  
  Parameters
  ----------
  dataset : SFrame
      Dataset of new observations. Must include the features used for
      model training; additional columns are ignored.
  
  output_type : {'cluster_id', 'distance'}, optional
      Form of the prediction. 'cluster_id' (the default) returns the
      cluster label assigned to each input instance, while 'distance'
      returns the Euclidean distance between the instance and its
      assigned cluster's center.
  
  verbose : bool, optional
      If True, print progress updates to the screen.
  
  Returns
  -------
  out : SArray
      Model predictions. Depending on the specified `output_type`, either
      the assigned cluster label or the distance of each point to its
      closest cluster center. The order of the predictions is the same as
      order of the input data rows.
  
  See Also
  --------
  create
  
  Examples
  --------
  >>> sf = turicreate.SFrame({
  ...     'x1': [0.6777, -9.391, 7.0385, 2.2657, 7.7864, -10.16, -8.162,
  ...            8.8817, -9.525, -9.153, 2.0860, 7.6619, 6.5511, 2.7020],
  ...     'x2': [5.6110, 8.5139, 5.3913, 5.4743, 8.3606, 7.8843, 2.7305,
  ...            5.1679, 6.7231, 3.7051, 1.7682, 7.4608, 3.1270, 6.5624]})
  ...
  >>> model = turicreate.kmeans.create(sf, num_clusters=3)
  ...
  >>> sf_new = turicreate.SFrame({'x1': [-5.6584, -1.0167, -9.6181],
  ...                           'x2': [-6.3803, -3.7937, -1.1022]})
  >>> clusters = model.predict(sf_new, output_type='cluster_id')
  >>> print clusters
  [1, 0, 1]
docstr_tok: ["Return","predicted","cluster","label","for","instances","in","the","new","'dataset","'",".","K-means","predictions","are","made","by","assigning","each","new","instance","to","the","closest","cluster","center",".","Parameters","--","--","--","--","--","dataset",":","SFrame","Dataset","of","new","observations",".","Must","include","the","features","used","for","model","training",";","additional","columns","are","ignored",".","output_type",":","{","'cluster_id","'",",","'distance","'","}",",","optional","Form","of","the","prediction",".","'cluster_id","'","(","the","default",")","returns","the","cluster","label","assigned","to","each","input","instance",",","while","'distance'","returns","the","Euclidean","distance","between","the","instance","and","its","assigned","cluster","'s","center",".","verbose",":","bool",",","optional","If","True",",","print","progress","updates","to","the","screen",".","Returns","--","--","--","-","out",":","SArray","Model","predictions",".","Depending","on","the","specified","`","output_type","`",",","either","the","assigned","cluster","label","or","the","distance","of","each","point","to","its","closest","cluster","center",".","The","order","of","the","predictions","is","the","same","as","order","of","the","input","data","rows",".","See","Also","--","--","--","--","create","Examples","--","--","--","--",">",">",">","sf","=","turicreate.SFrame","(","{","...","'x1","'",":","[","0.6777",",","-9.391",",","7.0385",",","2.2657",",","7.7864",",","-10.16",",","-8.162",",","...","8.8817",",","-9.525",",","-9.153",",","2.0860",",","7.6619",",","6.5511",",","2.7020","]",",","...","'x2","'",":","[","5.6110",",","8.5139",",","5.3913",",","5.4743",",","8.3606",",","7.8843",",","2.7305",",","...","5.1679",",","6.7231",",","3.7051",",","1.7682",",","7.4608",",","3.1270",",","6.5624","]","}",")","...",">",">",">","model","=","turicreate.kmeans.create","(","sf",",","num_clusters=3",")","...",">",">",">","sf_new","=","turicreate.SFrame","(","{","'x1","'",":","[","-5.6584",",","-1.0167",",","-9.6181","]",",","...","'x2","'",":","[","-6.3803",",","-3.7937",",","-1.1022","]","}",")",">",">",">","clusters","=","model.predict","(","sf_new",",","output_type='cluster_id","'",")",">",">",">","print","clusters","[","1",",","0",",","1","]"]
code: def predict(self, dataset, output_type="cluster_id", verbose=True):
      """
      Return predicted cluster label for instances in the new 'dataset'.
      K-means predictions are made by assigning each new instance to the
      closest cluster center.
  
      Parameters
      ----------
      dataset : SFrame
          Dataset of new observations. Must include the features used for
          model training; additional columns are ignored.
  
      output_type : {'cluster_id', 'distance'}, optional
          Form of the prediction. 'cluster_id' (the default) returns the
          cluster label assigned to each input instance, while 'distance'
          returns the Euclidean distance between the instance and its
          assigned cluster's center.
  
      verbose : bool, optional
          If True, print progress updates to the screen.
  
      Returns
      -------
      out : SArray
          Model predictions. Depending on the specified `output_type`, either
          the assigned cluster label or the distance of each point to its
          closest cluster center. The order of the predictions is the same as
          order of the input data rows.
  
      See Also
      --------
      create
  
      Examples
      --------
      >>> sf = turicreate.SFrame({
      ...     'x1': [0.6777, -9.391, 7.0385, 2.2657, 7.7864, -10.16, -8.162,
      ...            8.8817, -9.525, -9.153, 2.0860, 7.6619, 6.5511, 2.7020],
      ...     'x2': [5.6110, 8.5139, 5.3913, 5.4743, 8.3606, 7.8843, 2.7305,
      ...            5.1679, 6.7231, 3.7051, 1.7682, 7.4608, 3.1270, 6.5624]})
      ...
      >>> model = turicreate.kmeans.create(sf, num_clusters=3)
      ...
      >>> sf_new = turicreate.SFrame({'x1': [-5.6584, -1.0167, -9.6181],
      ...                           'x2': [-6.3803, -3.7937, -1.1022]})
      >>> clusters = model.predict(sf_new, output_type='cluster_id')
      >>> print clusters
      [1, 0, 1]
      """
  
      ## Validate the input dataset.
      _tkutl._raise_error_if_not_sframe(dataset, "dataset")
      _tkutl._raise_error_if_sframe_empty(dataset, "dataset")
  
      ## Validate the output type.
      if not isinstance(output_type, str):
          raise TypeError(
              "The 'output_type' parameter must be a string."
          )
  
      if not output_type in ("cluster_id", "distance"):
          raise ValueError(
              "The 'output_type' parameter must be either "
              + "'cluster_label' or 'distance'."
          )
  
      ## Get model features.
      ref_features = self.features
      sf_features = _tkutl._toolkits_select_columns(
          dataset, ref_features
      )
  
      ## Compute predictions.
      opts = {
          "model": self.__proxy__,
          "model_name": self.__name__,
          "dataset": sf_features,
      }
  
      with _QuietProgress(verbose):
          result = _tc.extensions._kmeans.predict(opts)
  
      sf_result = result["predictions"]
  
      if output_type == "distance":
          return sf_result["distance"]
      else:
          return sf_result["cluster_id"]
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import logging
  from array import array
  import turicreate
  from turicreate.toolkits._model import Model
  from turicreate.data_structures.sframe import SFrame
  import turicreate.toolkits._internal_utils
  from turicreate.toolkits._private_utils import _validate_row_label
  from turicreate.toolkits._private_utils import _summarize_accessible_fields
  from turicreate.toolkits._main import ToolkitError
  from turicreate._cython.cy_server import QuietProgress
label_desc: Use image node_id 3 for calling the KmeansModel obj's underlying member method code with example usage: obj.predict(dataset, output_type, verbose) and returns: sf_result, sf_result