class_docstr: Class that stores the results of a regression evaluation.
  
  Args:
      samples: the :class:`fiftyone.core.collections.SampleCollection` used
      config: the :class:`RegressionEvaluationConfig` used
      eval_key: the evaluation key
      ytrue: a list of ground truth values
      ypred: a list of predicted values
      confs (None): an optional list of confidences for the predictions
      eval_key (None): the evaluation key of the evaluation
      gt_field (None): the name of the ground truth field
      pred_field (None): the name of the predictions field
      ids (None): a list of sample or frame IDs corresponding to the
          regressions
      missing (None): a missing value. Any None-valued regressions are
          given this value for results purposes
      backend (None): a :class:`RegressionEvaluation` backend
class_docstr_tok: ["Class","that","stores","the","results","of","a","regression","evaluation",".","Args",":","samples",":","the",":","class",":","`","fiftyone.core.collections.SampleCollection","`","used","config",":","the",":","class",":","`","RegressionEvaluationConfig","`","used","eval_key",":","the","evaluation","key","ytrue",":","a","list","of","ground","truth","values","ypred",":","a","list","of","predicted","values","confs","(","None",")",":","an","optional","list","of","confidences","for","the","predictions","eval_key","(","None",")",":","the","evaluation","key","of","the","evaluation","gt_field","(","None",")",":","the","name","of","the","ground","truth","field","pred_field","(","None",")",":","the","name","of","the","predictions","field","ids","(","None",")",":","a","list","of","sample","or","frame","IDs","corresponding","to","the","regressions","missing","(","None",")",":","a","missing","value",".","Any","None-valued","regressions","are","given","this","value","for","results","purposes","backend","(","None",")",":","a",":","class",":","`","RegressionEvaluation","`","backend"]
docstr: Computes various popular regression metrics for the results.
  
  The computed metrics are:
  
  -   Mean squared error: :func:`sklearn:sklearn.metrics.mean_squared_error`
  -   Root mean squared error: :func:`sklearn:sklearn.metrics.mean_squared_error`
  -   Mean absolute error: :func:`sklearn:sklearn.metrics.mean_absolute_error`
  -   Median absolute error: :func:`sklearn:sklearn.metrics.median_absolute_error`
  -   R^2 score: :func:`sklearn:sklearn.metrics.r2_score`
  -   Explained variance score: :func:`sklearn:sklearn.metrics.explained_variance_score`
  -   Max error: :func:`sklearn:sklearn.metrics.max_error`
  -   Support: the number of examples
  
  Args:
      weights (None): an optional list of weights for each example
  
  Returns:
      a dict
docstr_tok: ["Computes","various","popular","regression","metrics","for","the","results",".","The","computed","metrics","are",":","-","Mean","squared","error",":",":","func",":","`","sklearn",":","sklearn.metrics.mean_squared_error","`","-","Root","mean","squared","error",":",":","func",":","`","sklearn",":","sklearn.metrics.mean_squared_error","`","-","Mean","absolute","error",":",":","func",":","`","sklearn",":","sklearn.metrics.mean_absolute_error","`","-","Median","absolute","error",":",":","func",":","`","sklearn",":","sklearn.metrics.median_absolute_error","`","-","R^2","score",":",":","func",":","`","sklearn",":","sklearn.metrics.r2_score","`","-","Explained","variance","score",":",":","func",":","`","sklearn",":","sklearn.metrics.explained_variance_score","`","-","Max","error",":",":","func",":","`","sklearn",":","sklearn.metrics.max_error","`","-","Support",":","the","number","of","examples","Args",":","weights","(","None",")",":","an","optional","list","of","weights","for","each","example","Returns",":","a","dict"]
code: def metrics(self, weights=None):
      """Computes various popular regression metrics for the results.
  
      The computed metrics are:
  
      -   Mean squared error: :func:`sklearn:sklearn.metrics.mean_squared_error`
      -   Root mean squared error: :func:`sklearn:sklearn.metrics.mean_squared_error`
      -   Mean absolute error: :func:`sklearn:sklearn.metrics.mean_absolute_error`
      -   Median absolute error: :func:`sklearn:sklearn.metrics.median_absolute_error`
      -   R^2 score: :func:`sklearn:sklearn.metrics.r2_score`
      -   Explained variance score: :func:`sklearn:sklearn.metrics.explained_variance_score`
      -   Max error: :func:`sklearn:sklearn.metrics.max_error`
      -   Support: the number of examples
  
      Args:
          weights (None): an optional list of weights for each example
  
      Returns:
          a dict
      """
      yt = self.ytrue
      yp = self.ypred
      w = weights
  
      if yt.size > 0:
          mse = skm.mean_squared_error(yt, yp, sample_weight=w)
          rmse = np.sqrt(mse)
          mae = skm.mean_absolute_error(yt, yp, sample_weight=w)
          median_absolute_error = skm.median_absolute_error(yt, yp)
          r2_score = skm.r2_score(yt, yp, sample_weight=w)
          ev_score = skm.explained_variance_score(
              yt, yp, sample_weight=w
          )
          max_error = skm.max_error(yt, yp)
          support = len(yt)
      else:
          mse = 0.0
          rmse = 0.0
          mae = 0.0
          median_absolute_error = 0.0
          r2_score = 0.0
          ev_score = 0.0
          max_error = 0.0
          support = 0
  
      return {
          "mean_squared_error": mse,
          "root_mean_squared_error": rmse,
          "mean_absolute_error": mae,
          "median_absolute_error": median_absolute_error,
          "r2_score": r2_score,
          "explained_variance_score": ev_score,
          "max_error": max_error,
          "support": support,
      }
  
imports: from copy import deepcopy
  import inspect
  import itertools
  import logging
  import numbers
  import numpy
  import sklearn.metrics
  from tabulate import tabulate
  import eta.core.utils
  import fiftyone
  import fiftyone.core.evaluation
  import fiftyone.core.fields
  import fiftyone.core.labels
  import fiftyone.core.plots
  import fiftyone.core.utils
  import fiftyone.core.validation
label_desc: Use image node_id 2 for calling the RegressionResults obj's underlying member method code with example usage: obj.metrics(weights) and returns: dict