docstr: Returns a confusion matrix based of H2O's default prediction threshold for a dataset.
  
  :param H2OFrame data: the frame with the prediction results for which the confusion matrix should be extracted.
  
  :examples:
  
  >>> cars = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/junit/cars_20mpg.csv")
  >>> cars["cylinders"] = cars["cylinders"].asfactor()
  >>> r = cars[0].runif()
  >>> train = cars[r > .2]
  >>> valid = cars[r <= .2]
  >>> response_col = "cylinders"
  >>> distribution = "multinomial"
  >>> predictors = ["displacement","power","weight","acceleration","year"]
  >>> gbm = H2OGradientBoostingEstimator(nfolds=3,
  ...                                    distribution=distribution)
  >>> gbm.train(x=predictors,
  ...           y=response_col,
  ...           training_frame=train,
  ...           validation_frame=valid)
  >>> confusion_matrix = gbm.confusion_matrix(train)
  >>> confusion_matrix
docstr_tok: ["Returns","a","confusion","matrix","based","of","H2O","'s","default","prediction","threshold","for","a","dataset",".",":","param","H2OFrame","data",":","the","frame","with","the","prediction","results","for","which","the","confusion","matrix","should","be","extracted",".",":","examples",":",">",">",">","cars","=","h2o.import_file","(","``","https",":","\/\/s3.amazonaws.com\/h2o-public-test-data\/smalldata\/junit\/cars_20mpg.csv","''",")",">",">",">","cars","[","``","cylinders","''","]","=","cars","[","``","cylinders","''","]",".asfactor","(",")",">",">",">","r","=","cars","[","0","]",".runif","(",")",">",">",">","train","=","cars","[","r",">",".2","]",">",">",">","valid","=","cars","[","r","<","=",".2","]",">",">",">","response_col","=","``","cylinders","''",">",">",">","distribution","=","``","multinomial","''",">",">",">","predictors","=","[","``","displacement","''",",","''","power","''",",","''","weight","''",",","''","acceleration","''",",","''","year","''","]",">",">",">","gbm","=","H2OGradientBoostingEstimator","(","nfolds=3",",","...","distribution=distribution",")",">",">",">","gbm.train","(","x=predictors",",","...","y=response_col",",","...","training_frame=train",",","...","validation_frame=valid",")",">",">",">","confusion_matrix","=","gbm.confusion_matrix","(","train",")",">",">",">","confusion_matrix"]
code: def confusion_matrix(self, data):
      """
      Returns a confusion matrix based of H2O's default prediction threshold for a dataset.
  
      :param H2OFrame data: the frame with the prediction results for which the confusion matrix should be extracted.
  
      :examples:
  
      >>> cars = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/junit/cars_20mpg.csv")
      >>> cars["cylinders"] = cars["cylinders"].asfactor()
      >>> r = cars[0].runif()
      >>> train = cars[r > .2]
      >>> valid = cars[r <= .2]
      >>> response_col = "cylinders"
      >>> distribution = "multinomial"
      >>> predictors = ["displacement","power","weight","acceleration","year"]
      >>> gbm = H2OGradientBoostingEstimator(nfolds=3,
      ...                                    distribution=distribution)
      >>> gbm.train(x=predictors,
      ...           y=response_col,
      ...           training_frame=train,
      ...           validation_frame=valid)
      >>> confusion_matrix = gbm.confusion_matrix(train)
      >>> confusion_matrix
      """
      assert_is_type(data, H2OFrame)
      j = h2o.api(
          "POST /3/Predictions/models/%s/frames/%s"
          % (self._id, data.frame_id)
      )
      return j["model_metrics"][0]["cm"]["table"]
  
file_path: h2o-3/h2o-py/h2o/model/models/multinomial.py
imports: import h2o
  from h2o.exceptions import H2OValueError
  from h2o.frame import H2OFrame
  from h2o.model import ModelBase
  from h2o.model.extensions import has_extension
  from h2o.utils.compatibility import *
  from h2o.utils.typechecks import assert_is_type
label_desc: Use image node_id 1 for calling the H2OMultinomialModel obj's underlying member method code with example usage: obj.confusion_matrix(data) and returns: j