class_docstr: Tools for vectorized statistics on MLlib Vectors.
  The methods in this package provide various statistics for Vectors contained inside DataFrames.
  This class lets users pick the statistics they would like to extract for a given column.
  
  .. versionadded:: 2.4.0
  
  Examples
  --------
  >>> from pyspark.ml.stat import Summarizer
  >>> from pyspark.sql import Row
  >>> from pyspark.ml.linalg import Vectors
  >>> summarizer = Summarizer.metrics("mean", "count")
  >>> df = sc.parallelize([Row(weight=1.0, features=Vectors.dense(1.0, 1.0, 1.0)),
  ...                      Row(weight=0.0, features=Vectors.dense(1.0, 2.0, 3.0))]).toDF()
  >>> df.select(summarizer.summary(df.features, df.weight)).show(truncate=False)
  +-----------------------------------+
  |aggregate_metrics(features, weight)|
  +-----------------------------------+
  |{[1.0,1.0,1.0], 1}                 |
  +-----------------------------------+
  >>> df.select(summarizer.summary(df.features)).show(truncate=False)
  +--------------------------------+
  |aggregate_metrics(features, 1.0)|
  +--------------------------------+
  |{[1.0,1.5,2.0], 2}              |
  +--------------------------------+
  >>> df.select(Summarizer.mean(df.features, df.weight)).show(truncate=False)
  +--------------+
  |mean(features)|
  +--------------+
  |[1.0,1.0,1.0] |
  +--------------+
  >>> df.select(Summarizer.mean(df.features)).show(truncate=False)
  +--------------+
  |mean(features)|
  +--------------+
  |[1.0,1.5,2.0] |
  +--------------+
class_docstr_tok: ["Tools","for","vectorized","statistics","on","MLlib","Vectors",".","The","methods","in","this","package","provide","various","statistics","for","Vectors","contained","inside","DataFrames",".","This","class","lets","users","pick","the","statistics","they","would","like","to","extract","for","a","given","column",".","..","versionadded",":",":","2.4.0","Examples","--","--","--","--",">",">",">","from","pyspark.ml.stat","import","Summarizer",">",">",">","from","pyspark.sql","import","Row",">",">",">","from","pyspark.ml.linalg","import","Vectors",">",">",">","summarizer","=","Summarizer.metrics","(","``","mean","''",",","``","count","''",")",">",">",">","df","=","sc.parallelize","(","[","Row","(","weight=1.0",",","features=Vectors.dense","(","1.0",",","1.0",",","1.0",")",")",",","...","Row","(","weight=0.0",",","features=Vectors.dense","(","1.0",",","2.0",",","3.0",")",")","]",")",".toDF","(",")",">",">",">","df.select","(","summarizer.summary","(","df.features",",","df.weight",")",")",".show","(","truncate=False",")","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|aggregate_metrics","(","features",",","weight",")","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","{","[","1.0,1.0,1.0","]",",","1","}","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+",">",">",">","df.select","(","summarizer.summary","(","df.features",")",")",".show","(","truncate=False",")","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|aggregate_metrics","(","features",",","1.0",")","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","{","[","1.0,1.5,2.0","]",",","2","}","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+",">",">",">","df.select","(","Summarizer.mean","(","df.features",",","df.weight",")",")",".show","(","truncate=False",")","+","--","--","--","--","--","--","--","+","|mean","(","features",")","|","+","--","--","--","--","--","--","--","+","|","[","1.0,1.0,1.0","]","|","+","--","--","--","--","--","--","--","+",">",">",">","df.select","(","Summarizer.mean","(","df.features",")",")",".show","(","truncate=False",")","+","--","--","--","--","--","--","--","+","|mean","(","features",")","|","+","--","--","--","--","--","--","--","+","|","[","1.0,1.5,2.0","]","|","+","--","--","--","--","--","--","--","+"]
code: def _get_single_metric(
      col: Column, weightCol: Optional[Column], metric: str
  ) -> Column:
      col, weightCol = Summarizer._check_param(col, weightCol)
      return Column(
          JavaWrapper._new_java_obj(
              "org.apache.spark.ml.stat.Summarizer." + metric,
              col._jc,
              weightCol._jc,
          )
      )
  
imports: import sys
  from typing import Optional, Tuple, TYPE_CHECKING
  from pyspark import since, SparkContext
  from pyspark.ml.common import _java2py, _py2java
  from pyspark.ml.linalg import Matrix, Vector
  from pyspark.ml.wrapper import JavaWrapper, _jvm
  from pyspark.sql.column import Column, _to_seq
  from pyspark.sql.dataframe import DataFrame
  from pyspark.sql.functions import lit
label_desc: Use image node_id 12 for calling the Summarizer obj's underlying member method code with example usage: obj._get_single_metric(col, weightCol, metric) and returns: Column