code: def confusion_matrix(targets, predictions):
      r"""
      Compute the confusion matrix for classifier predictions.
  
      Parameters
      ----------
      targets : SArray
          Ground truth class labels (cannot be of type float).
  
      predictions : SArray
          The prediction that corresponds to each target value.
          This vector must have the same length as ``targets``. The predictions
          SArray cannot be of type float.
  
      Returns
      -------
      out : SFrame
          An SFrame containing counts for 'target_label', 'predicted_label' and
          'count' corresponding to each pair of true and predicted labels.
  
      See Also
      --------
      accuracy
  
      Examples
      --------
      >>> targets = turicreate.SArray([0, 1, 1, 0])
      >>> predictions = turicreate.SArray([1, 0, 1, 0])
  
      >>> turicreate.evaluation.confusion_matrix(targets, predictions)
      """
  
      _supervised_evaluation_error_checking(targets, predictions)
      _check_same_type_not_float(targets, predictions)
      return _turicreate.extensions._supervised_streaming_evaluator(
          targets, predictions, "confusion_matrix_no_map", {}
      )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import turicreate
  from turicreate.toolkits._internal_utils import _raise_error_if_not_sarray, _check_categorical_option_type
  from turicreate.toolkits._main import ToolkitError
label_desc: Use image node_id 9 for calling a global function with example usage: confusion_matrix(targets, predictions) and returns: _turicreate