class_docstr: Estimator of the error from DP pipeline from DatasetHistograms.
  
  The recommended way to create this object is to use create_error_estimator.
  It works only for COUNT and PRIVACY_ID_COUNT.
  
  Partition selection error is not implemented yet. Now only contribution
  bounding and noise error are taken into consideration.
docstr: Estimates RMSE error for given l0 and linf bounds.
  
  Estimation algorithm is the following:
  1. From l0_bound and l0_contributions_histogram the ratio data dropped
    from l0 contribution bounding is computed.
  2. From linf_bound and linf_contributions_histogram the
    ratio data dropped from linf contribution bounding is computed.
  3. The total 'ratio_data_dropped' for contribution bounding is estimated
    from l0 and linf ratios data dropped.
  4. Then under the assumption that contribution bounding drops data
    uniformly on all partitions, for a partition of the size n, it is
    assumed that n*ratio_data_dropped data points are dropped with
    contribution bounding. And RMSE for this partition is computed as
    sqrt((n*ratio_data_dropped)**2 + noise_std**2)
  5. RMSE are averaged across all partitions.
  
  Args:
      l0_bound: l0 contribution bound, AKA max_partition_contributed.
      linf_bound: linf contribution bound, AKA for COUNT as
        max_contributions_per_partition. This parameter is ignored for
        PRIVACY_ID_COUNT
  Returns:
      the estimated error.
docstr_tok: ["Estimates","RMSE","error","for","given","l0","and","linf","bounds",".","Estimation","algorithm","is","the","following",":","1",".","From","l0_bound","and","l0_contributions_histogram","the","ratio","data","dropped","from","l0","contribution","bounding","is","computed",".","2",".","From","linf_bound","and","linf_contributions_histogram","the","ratio","data","dropped","from","linf","contribution","bounding","is","computed",".","3",".","The","total","'ratio_data_dropped","'","for","contribution","bounding","is","estimated","from","l0","and","linf","ratios","data","dropped",".","4",".","Then","under","the","assumption","that","contribution","bounding","drops","data","uniformly","on","all","partitions",",","for","a","partition","of","the","size","n",",","it","is","assumed","that","n","*","ratio_data_dropped","data","points","are","dropped","with","contribution","bounding",".","And","RMSE","for","this","partition","is","computed","as","sqrt","(","(","n","*","ratio_data_dropped",")","*","*","2","+","noise_std","*","*","2",")","5",".","RMSE","are","averaged","across","all","partitions",".","Args",":","l0_bound",":","l0","contribution","bound",",","AKA","max_partition_contributed",".","linf_bound",":","linf","contribution","bound",",","AKA","for","COUNT","as","max_contributions_per_partition",".","This","parameter","is","ignored","for","PRIVACY_ID_COUNT","Returns",":","the","estimated","error","."]
code: def estimate_rmse(
      self, l0_bound: int, linf_bound: Optional[int] = None
  ) -> float:
      """Estimates RMSE error for given l0 and linf bounds.
  
      Estimation algorithm is the following:
      1. From l0_bound and l0_contributions_histogram the ratio data dropped
        from l0 contribution bounding is computed.
      2. From linf_bound and linf_contributions_histogram the
        ratio data dropped from linf contribution bounding is computed.
      3. The total 'ratio_data_dropped' for contribution bounding is estimated
        from l0 and linf ratios data dropped.
      4. Then under the assumption that contribution bounding drops data
        uniformly on all partitions, for a partition of the size n, it is
        assumed that n*ratio_data_dropped data points are dropped with
        contribution bounding. And RMSE for this partition is computed as
        sqrt((n*ratio_data_dropped)**2 + noise_std**2)
      5. RMSE are averaged across all partitions.
  
      Args:
          l0_bound: l0 contribution bound, AKA max_partition_contributed.
          linf_bound: linf contribution bound, AKA for COUNT as
            max_contributions_per_partition. This parameter is ignored for
            PRIVACY_ID_COUNT
      Returns:
          the estimated error.
      """
      if self._metric == pipeline_dp.Metrics.COUNT:
          if linf_bound is None:
              raise ValueError("linf must be given for COUNT")
      ratio_dropped_l0 = self.get_ratio_dropped_l0(l0_bound)
      ratio_dropped_linf = 0
      if self._metric == pipeline_dp.Metrics.COUNT:
          ratio_dropped_linf = self.get_ratio_dropped_linf(linf_bound)
      ratio_dropped = 1 - (1 - ratio_dropped_l0) * (
          1 - ratio_dropped_linf
      )
      stddev = self._get_stddev(l0_bound, linf_bound)
      return _estimate_rmse_impl(
          ratio_dropped, stddev, self._partition_histogram
      )
  
file_path: pipelinedp/pipeline_dp/dataset_histograms/histogram_error_estimator.py
imports: import pipeline_dp
  from pipeline_dp.dataset_histograms import histograms
  from typing import Optional, Sequence, Tuple
  import math
  import bisect
label_desc: Use image node_id 2 for calling the CountErrorEstimator obj's underlying member method code with example usage: obj.estimate_rmse(l0_bound, linf_bound) and returns: _estimate_rmse_impl