code: def rmse(predictions, truth, missing="error"):
      """
      Compute RMSE (root mean squared error).  This is computed as:
  
      .. math::
          \\sum_{r_{ui} \\in R} \\left(r_{ui} - s(i|u)\\right)^2
  
      When used with :func:`user_metric`, or on series grouped by user, it computes
      a per-user RMSE; when applied to an entire prediction frame, it computes global
      RMSE.  It does not do any fallbacks; if you want to compute RMSE with fallback
      predictions (e.g. usign a bias model when a collaborative filter cannot predict),
      generate predictions with :class:`lenskit.algorithms.basic.Fallback`.
  
      Args:
          predictions(pandas.Series): the predictions
          truth(pandas.Series): the ground truth ratings from data
          missing(string):
              how to handle predictions without truth. Can be one of
              ``'error'`` or ``'ignore'``.
  
      Returns:
          double: the root mean squared approximation error
      """
  
      # force into series (basically no-op if already a series)
      predictions = pd.Series(predictions)
      truth = pd.Series(truth)
  
      # realign
      predictions, truth = predictions.align(truth, join="left")
      _check_missing(truth, missing)
  
      diff = predictions - truth
  
      sqdiff = diff.apply(np.square)
      msq = sqdiff.mean()
      return np.sqrt(msq)
  
imports: import numpy
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: rmse(predictions, truth, missing) and returns: np