code: def to_result(self, metrics: List[str]) -> Dict[str, Any]:
      result = {}
  
      for metric in metrics:
          if metric == "min":
              result["min"] = self.min_values.copy()
          if metric == "max":
              result["max"] = self.max_values.copy()
          if metric == "sum":
              result["sum"] = self.sum_values.copy()
          if metric == "mean":
              result["mean"] = self.sum_values / self.count
          if metric == "std":
              if self.count <= 1:
                  raise ValueError(
                      "Standard deviation evaluation requires more than one row data."
                  )
              result["std"] = np.sqrt(
                  (
                      (self.square_sum_values / self.count)
                      - np.square(self.sum_values / self.count)
                  )
                  * (self.count / (self.count - 1))
              )
          if metric == "count":
              result["count"] = self.count  # type: ignore[assignment]
  
      return result
  
file_path: spark/python/pyspark/ml/connect/summarizer.py
imports: from typing import Any, Union, List, Dict
  import numpy
  import pandas
  from pyspark.sql import DataFrame
  from pyspark.ml.connect.util import aggregate_dataframe
label_desc: Use image node_id 4 for calling the SummarizerAggState obj's underlying member method code with example usage: obj.to_result(metrics) and returns: result