class_docstr: The abstract class for Turi Create recommender system models. This class
  defines methods common to all recommender system models, but leaves unique
  model details to separate model classes.
class_docstr_tok: ["The","abstract","class","for","Turi","Create","recommender","system","models",".","This","class","defines","methods","common","to","all","recommender","system","models",",","but","leaves","unique","model","details","to","separate","model","classes","."]
docstr: Evaluate the prediction error for each user-item pair in the given data
  set.
  
  Parameters
  ----------
  dataset : SFrame
      An SFrame in the same format as the one used during training.
  
  target : str
      The name of the target rating column in `dataset`.
  
  Returns
  -------
  out : dict
      A dictionary with three items: 'rmse_by_user' and 'rmse_by_item',
      which are SFrames containing the average rmse for each user and
      item, respectively; and 'rmse_overall', which is a float.
  
  Examples
  --------
  >>> import turicreate as tc
  >>> sf = tc.SFrame('https://static.turi.com/datasets/audioscrobbler')
  >>> train, test = tc.recommender.util.random_split_by_user(sf)
  >>> m = tc.recommender.create(train, target='target')
  >>> m.evaluate_rmse(test, target='target')
  
  See Also
  --------
  turicreate.evaluation.rmse
docstr_tok: ["Evaluate","the","prediction","error","for","each","user-item","pair","in","the","given","data","set",".","Parameters","--","--","--","--","--","dataset",":","SFrame","An","SFrame","in","the","same","format","as","the","one","used","during","training",".","target",":","str","The","name","of","the","target","rating","column","in","`","dataset","`",".","Returns","--","--","--","-","out",":","dict","A","dictionary","with","three","items",":","'rmse_by_user","'","and","'rmse_by_item","'",",","which","are","SFrames","containing","the","average","rmse","for","each","user","and","item",",","respectively",";","and","'rmse_overall","'",",","which","is","a","float",".","Examples","--","--","--","--",">",">",">","import","turicreate","as","tc",">",">",">","sf","=","tc.SFrame","(","'https",":","\/\/static.turi.com\/datasets\/audioscrobbler","'",")",">",">",">","train",",","test","=","tc.recommender.util.random_split_by_user","(","sf",")",">",">",">","m","=","tc.recommender.create","(","train",",","target='target","'",")",">",">",">","m.evaluate_rmse","(","test",",","target='target","'",")","See","Also","--","--","--","--","turicreate.evaluation.rmse"]
code: def evaluate_rmse(self, dataset, target):
      """
      Evaluate the prediction error for each user-item pair in the given data
      set.
  
      Parameters
      ----------
      dataset : SFrame
          An SFrame in the same format as the one used during training.
  
      target : str
          The name of the target rating column in `dataset`.
  
      Returns
      -------
      out : dict
          A dictionary with three items: 'rmse_by_user' and 'rmse_by_item',
          which are SFrames containing the average rmse for each user and
          item, respectively; and 'rmse_overall', which is a float.
  
      Examples
      --------
      >>> import turicreate as tc
      >>> sf = tc.SFrame('https://static.turi.com/datasets/audioscrobbler')
      >>> train, test = tc.recommender.util.random_split_by_user(sf)
      >>> m = tc.recommender.create(train, target='target')
      >>> m.evaluate_rmse(test, target='target')
  
      See Also
      --------
      turicreate.evaluation.rmse
      """
  
      assert (
          target in dataset.column_names()
      ), "Provided dataset must contain a target column with the same \
                  name as the target used during training."
      y = dataset[target]
      yhat = self.predict(dataset)
      user_column = self.user_id
      item_column = self.item_id
      assert (
          user_column in dataset.column_names()
          and item_column in dataset.column_names()
      ), "Provided data set must have a column pertaining to user ids and \
               item ids, similar to what we had during training."
  
      result = dataset[[user_column, item_column]]
      result["sq_error"] = (y - yhat) * (y - yhat)
      rmse_by_user = result.groupby(
          user_column,
          {
              "rmse": _turicreate.aggregate.AVG("sq_error"),
              "count": _turicreate.aggregate.COUNT,
          },
      )
      rmse_by_user["rmse"] = rmse_by_user["rmse"].apply(
          lambda x: x**0.5
      )
      rmse_by_item = result.groupby(
          item_column,
          {
              "rmse": _turicreate.aggregate.AVG("sq_error"),
              "count": _turicreate.aggregate.COUNT,
          },
      )
      rmse_by_item["rmse"] = rmse_by_item["rmse"].apply(
          lambda x: x**0.5
      )
      overall_rmse = result["sq_error"].mean() ** 0.5
  
      return {
          "rmse_by_user": rmse_by_user,
          "rmse_by_item": rmse_by_item,
          "rmse_overall": overall_rmse,
      }
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import turicreate
  import random
  import array
  import logging
  import time
  import six
  from turicreate.toolkits import _coreml_utils
  from turicreate.toolkits._main import ToolkitError
  from turicreate.toolkits._model import Model
  from turicreate.toolkits._internal_utils import _toolkit_repr_print, _precomputed_field
  import turicreate.aggregate
  from turicreate.data_structures.sarray import SArray
  from turicreate.data_structures.sframe import SFrame
  from turicreate._deps import numpy, HAS_NUMPY
label_desc: Use image node_id 19 for calling the _Recommender obj's underlying member method code with example usage: obj.evaluate_rmse(dataset, target) and returns: dict