# Path: ehr_prediction_modeling/eval/metrics_data.py
# MAX_METRICS_KEY_LENGTH = 64
# class MetricsData():
# class BinaryMetricsData(MetricsData):
# class RegressionMetricsData(MetricsData):
#   def get_metrics(self) -> Mapping[str, Any]:
#   def add_data(self):
#   def log_metrics(self, target_name: str, current_step: int) -> None:
#   def __init__(
#       self,
#       positive_predictions: Optional[List[float]] = None,
#       negative_predictions: Optional[List[float]] = None,
#       positive_weights: Optional[List[float]] = None,
#       negative_weights: Optional[List[float]] = None):
#   def __eq__(self, other):
#   def __str__(self):
#   def add_data(self, positive_predictions, negative_predictions,
#                positive_weights, negative_weights):
#   def get_metrics(self) -> Mapping[str, Any]:
#   def __init__(
#       self,
#       predictions: Optional[List[float]] = None,
#       targets: Optional[List[float]] = None,
#       weights: Optional[List[float]] = None) -> None:
#   def __eq__(self, other):
#   def __str__(self):
#   def add_data(self, predictions, targets, weights):
#   def get_metrics(self) -> Mapping[str, Any]:


import collections
import os
import dataclasses
import numpy as np
import tensorflow.compat.v1 as tf
from typing import List, Mapping, Optional, Tuple, Type
from absl import logging
from ehr_prediction_modeling.eval import metrics_data

# Lint as: python3
"""Coordinator for metrics of various targets in evaluation."""





@dataclasses.dataclass(frozen=True)
class MetricsTarget(object):
  """Describes a target metrics will be computed for."""
  target_name: str
  split_name: str
  mask_name: Optional[str] = None


  def to_string(self) -> str:
    """Returns a string description of this target."""
    return (f"Target: {self.target_name}, Split: {self.split_name}, Mask: "
            f"{self.mask_name}")


class MetricsCoordinator(object):
  """Base class for accumulating data used to calculate metrics."""

  def __init__(self):
    """Initializes metrics coordinator."""
    self._data_dict = {}

  def add_data(self,

# Path: ehr_prediction_modeling/eval/metrics_data.py
# MAX_METRICS_KEY_LENGTH = 64
# class MetricsData():
# class BinaryMetricsData(MetricsData):
# class RegressionMetricsData(MetricsData):
#   def get_metrics(self) -> Mapping[str, Any]:
#   def add_data(self):
#   def log_metrics(self, target_name: str, current_step: int) -> None:
#   def __init__(
#       self,
#       positive_predictions: Optional[List[float]] = None,
#       negative_predictions: Optional[List[float]] = None,
#       positive_weights: Optional[List[float]] = None,
#       negative_weights: Optional[List[float]] = None):
#   def __eq__(self, other):
#   def __str__(self):
#   def add_data(self, positive_predictions, negative_predictions,
#                positive_weights, negative_weights):
#   def get_metrics(self) -> Mapping[str, Any]:
#   def __init__(
#       self,
#       predictions: Optional[List[float]] = None,
#       targets: Optional[List[float]] = None,
#       weights: Optional[List[float]] = None) -> None:
#   def __eq__(self, other):
#   def __str__(self):
#   def add_data(self, predictions, targets, weights):
#   def get_metrics(self) -> Mapping[str, Any]:


# Path: ehr_prediction_modeling/eval/metrics_coordinator.py
import collections
import os
import dataclasses
import numpy as np
import tensorflow.compat.v1 as tf
from typing import List, Mapping, Optional, Tuple, Type
from absl import logging
from ehr_prediction_modeling.eval import metrics_data


# Lint as: python3
"""Coordinator for metrics of various targets in evaluation."""





@dataclasses.dataclass(frozen=True)
class MetricsTarget(object):
  """Describes a target metrics will be computed for."""
  target_name: str
  split_name: str
  mask_name: Optional[str] = None


  def to_string(self) -> str:
    """Returns a string description of this target."""
    return (f"Target: {self.target_name}, Split: {self.split_name}, Mask: "
            f"{self.mask_name}")


class MetricsCoordinator(object):
  """Base class for accumulating data used to calculate metrics."""

  def __init__(self):
    """Initializes metrics coordinator."""
    self._data_dict = {}

  def add_data(self,

               metrics_data_type: Type[metrics_data.MetricsTypes],