docstr: Computes the coefficient of determination (R-squared) of predictions with respect to references.
  
  Parameters:
      predictions (List or np.ndarray): The predicted values.
      references (List or np.ndarray): The true/reference values.
  
  Returns:
      float: The R-squared value, rounded to 3 decimal places.
docstr_tok: ["Computes","the","coefficient","of","determination","(","R-squared",")","of","predictions","with","respect","to","references",".","Parameters",":","predictions","(","List","or","np.ndarray",")",":","The","predicted","values",".","references","(","List","or","np.ndarray",")",":","The","true\/reference","values",".","Returns",":","float",":","The","R-squared","value",",","rounded","to","3","decimal","places","."]
code: def _compute(self, predictions=None, references=None):
      """
      Computes the coefficient of determination (R-squared) of predictions with respect to references.
  
      Parameters:
          predictions (List or np.ndarray): The predicted values.
          references (List or np.ndarray): The true/reference values.
  
      Returns:
          float: The R-squared value, rounded to 3 decimal places.
      """
      predictions = np.array(predictions)
      references = np.array(references)
  
      # Calculate mean of the references
      mean_references = np.mean(references)
  
      # Calculate sum of squared residuals
      ssr = np.sum((predictions - references) ** 2)
  
      # Calculate sum of squared total
      sst = np.sum((references - mean_references) ** 2)
  
      # Calculate R Squared
      r_squared = 1 - (ssr / sst)
  
      # Round off to 3 decimal places
      rounded_r_squared = round(r_squared, 3)
  
      return rounded_r_squared
  
imports: import datasets
  import numpy
  import evaluate
label_desc: Use image node_id 2 for calling the r_squared obj's underlying member method code with example usage: obj._compute(predictions, references) and returns: rounded_r_squared