class_docstr: Errors between actual and dp metric.
  
  This class describes breakdown of errors for (dp_value - actual_value),
  where value can be a metric like count, sum etc. The value error is a random
  variable and it comes from different sources - contribution bounding error
  and DP noise. This class contains different error metrics.
  
  All attributes correspond to the errors computed per partition and then
  averaged across partitions, e.g.
    rmse_per_partition = sqrt(E(dp_value - actual_value)^2)
    self.rmse = mean(rmse_per_partition)
  
  Attributes:
      bounding_errors: contribution bounding errors.
      mean: averaged across partitions E(dp_value - actual_value), aka
       statistical bias.
      variance: averaged across partitions Var(dp_value - actual_value).
      rmse: averaged across partitions sqrt(E(dp_value - actual_value)^2).
      l1: averaged across partitions E|dp_value - actual_value|.
      with_dropped_partitions: error which takes into consideration partitions
        dropped due to partition selection. See example below.
class_docstr_tok: ["Errors","between","actual","and","dp","metric",".","This","class","describes","breakdown","of","errors","for","(","dp_value","-","actual_value",")",",","where","value","can","be","a","metric","like","count",",","sum","etc",".","The","value","error","is","a","random","variable","and","it","comes","from","different","sources","-","contribution","bounding","error","and","DP","noise",".","This","class","contains","different","error","metrics",".","All","attributes","correspond","to","the","errors","computed","per","partition","and","then","averaged","across","partitions",",","e.g",".","rmse_per_partition","=","sqrt","(","E","(","dp_value","-","actual_value",")","^2",")","self.rmse","=","mean","(","rmse_per_partition",")","Attributes",":","bounding_errors",":","contribution","bounding","errors",".","mean",":","averaged","across","partitions","E","(","dp_value","-","actual_value",")",",","aka","statistical","bias",".","variance",":","averaged","across","partitions","Var","(","dp_value","-","actual_value",")",".","rmse",":","averaged","across","partitions","sqrt","(","E","(","dp_value","-","actual_value",")","^2",")",".","l1",":","averaged","across","partitions","E|dp_value","-","actual_value|",".","with_dropped_partitions",":","error","which","takes","into","consideration","partitions","dropped","due","to","partition","selection",".","See","example","below","."]
docstr: Converts from absolute to relative error dividing by actual_value.
docstr_tok: ["Converts","from","absolute","to","relative","error","dividing","by","actual_value","."]
code: def to_relative(self, value: float):
      """Converts from absolute to relative error dividing by actual_value."""
      if value == 0:
          # When the actual value is 0, the relative error can't be computed.
          # Set relative errors to 0 in order not to influence aggregated
          # relative error.
          empty_bounding = ContributionBoundingErrors(
              l0=MeanVariance(0, 0), linf_min=0, linf_max=0
          )
          return ValueErrors(
              bounding_errors=empty_bounding,
              mean=0,
              variance=0,
              rmse=0,
              l1=0,
              rmse_with_dropped_partitions=0,
              l1_with_dropped_partitions=0,
          )
      return ValueErrors(
          self.bounding_errors.to_relative(value),
          mean=self.mean / value,
          variance=self.variance / value**2,
          rmse=self.rmse / value,
          l1=self.l1 / value,
          rmse_with_dropped_partitions=self.rmse_with_dropped_partitions
          / value,
          l1_with_dropped_partitions=self.l1_with_dropped_partitions
          / value,
      )
  
file_path: pipelinedp/analysis/metrics.py
imports: from enum import Enum
  import pipeline_dp
  from dataclasses import dataclass
  from typing import List, Optional
  import math
label_desc: Use image node_id 1 for calling the ValueErrors obj's underlying member method code with example usage: obj.to_relative(value) and returns: ValueErrors, ValueErrors