class_docstr: Spark Rating Evaluator
class_docstr_tok: ["Spark","Rating","Evaluator"]
docstr: Calculate R squared.
  
  Returns:
      float: R squared.
docstr_tok: ["Calculate","R","squared",".","Returns",":","float",":","R","squared","."]
code: def rsquared(self):
      """Calculate R squared.
  
      Returns:
          float: R squared.
      """
      return self.metrics.r2
  
imports: import numpy
  from recommenders.utils.constants import DEFAULT_PREDICTION_COL, DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_RELEVANCE_COL, DEFAULT_SIMILARITY_COL, DEFAULT_ITEM_FEATURES_COL, DEFAULT_ITEM_SIM_MEASURE, DEFAULT_TIMESTAMP_COL, DEFAULT_K, DEFAULT_THRESHOLD
label_desc: Use image node_id 4 for calling the SparkRatingEvaluation obj's underlying member method code with example usage: obj.rsquared() and returns: self