class_docstr: Conduct the two-sided Kolmogorov Smirnov (KS) test for data sampled from a continuous
  distribution.
  
  By comparing the largest difference between the empirical cumulative
  distribution of the sample data and the theoretical distribution we can provide a test for the
  the null hypothesis that the sample data comes from that theoretical distribution.
  
  .. versionadded:: 2.4.0
class_docstr_tok: ["Conduct","the","two-sided","Kolmogorov","Smirnov","(","KS",")","test","for","data","sampled","from","a","continuous","distribution",".","By","comparing","the","largest","difference","between","the","empirical","cumulative","distribution","of","the","sample","data","and","the","theoretical","distribution","we","can","provide","a","test","for","the","the","null","hypothesis","that","the","sample","data","comes","from","that","theoretical","distribution",".","..","versionadded",":",":","2.4.0"]
docstr: Conduct a one-sample, two-sided Kolmogorov-Smirnov test for probability distribution
  equality. Currently supports the normal distribution, taking as parameters the mean and
  standard deviation.
  
  .. versionadded:: 2.4.0
  
  Parameters
  ----------
  dataset : :py:class:`pyspark.sql.DataFrame`
      a Dataset or a DataFrame containing the sample of data to test.
  sampleCol : str
      Name of sample column in dataset, of any numerical type.
  distName : str
      a `string` name for a theoretical distribution, currently only support "norm".
  params : float
      a list of `float` values specifying the parameters to be used for the theoretical
      distribution. For "norm" distribution, the parameters includes mean and variance.
  
  Returns
  -------
  A DataFrame that contains the Kolmogorov-Smirnov test result for the input sampled data.
  This DataFrame will contain a single Row with the following fields:
  
  - `pValue: Double`
  - `statistic: Double`
  
  Examples
  --------
  >>> from pyspark.ml.stat import KolmogorovSmirnovTest
  >>> dataset = [[-1.0], [0.0], [1.0]]
  >>> dataset = spark.createDataFrame(dataset, ['sample'])
  >>> ksResult = KolmogorovSmirnovTest.test(dataset, 'sample', 'norm', 0.0, 1.0).first()
  >>> round(ksResult.pValue, 3)
  1.0
  >>> round(ksResult.statistic, 3)
  0.175
  >>> dataset = [[2.0], [3.0], [4.0]]
  >>> dataset = spark.createDataFrame(dataset, ['sample'])
  >>> ksResult = KolmogorovSmirnovTest.test(dataset, 'sample', 'norm', 3.0, 1.0).first()
  >>> round(ksResult.pValue, 3)
  1.0
  >>> round(ksResult.statistic, 3)
  0.175
docstr_tok: ["Conduct","a","one-sample",",","two-sided","Kolmogorov-Smirnov","test","for","probability","distribution","equality",".","Currently","supports","the","normal","distribution",",","taking","as","parameters","the","mean","and","standard","deviation",".","..","versionadded",":",":","2.4.0","Parameters","--","--","--","--","--","dataset",":",":","py",":","class",":","`","pyspark.sql.DataFrame","`","a","Dataset","or","a","DataFrame","containing","the","sample","of","data","to","test",".","sampleCol",":","str","Name","of","sample","column","in","dataset",",","of","any","numerical","type",".","distName",":","str","a","`","string","`","name","for","a","theoretical","distribution",",","currently","only","support","``","norm","''",".","params",":","float","a","list","of","`","float","`","values","specifying","the","parameters","to","be","used","for","the","theoretical","distribution",".","For","``","norm","''","distribution",",","the","parameters","includes","mean","and","variance",".","Returns","--","--","--","-","A","DataFrame","that","contains","the","Kolmogorov-Smirnov","test","result","for","the","input","sampled","data",".","This","DataFrame","will","contain","a","single","Row","with","the","following","fields",":","-","`","pValue",":","Double","`","-","`","statistic",":","Double","`","Examples","--","--","--","--",">",">",">","from","pyspark.ml.stat","import","KolmogorovSmirnovTest",">",">",">","dataset","=","[","[","-1.0","]",",","[","0.0","]",",","[","1.0","]","]",">",">",">","dataset","=","spark.createDataFrame","(","dataset",",","[","'sample","'","]",")",">",">",">","ksResult","=","KolmogorovSmirnovTest.test","(","dataset",",","'sample","'",",","'norm","'",",","0.0",",","1.0",")",".first","(",")",">",">",">","round","(","ksResult.pValue",",","3",")","1.0",">",">",">","round","(","ksResult.statistic",",","3",")","0.175",">",">",">","dataset","=","[","[","2.0","]",",","[","3.0","]",",","[","4.0","]","]",">",">",">","dataset","=","spark.createDataFrame","(","dataset",",","[","'sample","'","]",")",">",">",">","ksResult","=","KolmogorovSmirnovTest.test","(","dataset",",","'sample","'",",","'norm","'",",","3.0",",","1.0",")",".first","(",")",">",">",">","round","(","ksResult.pValue",",","3",")","1.0",">",">",">","round","(","ksResult.statistic",",","3",")","0.175"]
code: def test(
      dataset: DataFrame, sampleCol: str, distName: str, *params: float
  ) -> DataFrame:
      """
      Conduct a one-sample, two-sided Kolmogorov-Smirnov test for probability distribution
      equality. Currently supports the normal distribution, taking as parameters the mean and
      standard deviation.
  
      .. versionadded:: 2.4.0
  
      Parameters
      ----------
      dataset : :py:class:`pyspark.sql.DataFrame`
          a Dataset or a DataFrame containing the sample of data to test.
      sampleCol : str
          Name of sample column in dataset, of any numerical type.
      distName : str
          a `string` name for a theoretical distribution, currently only support "norm".
      params : float
          a list of `float` values specifying the parameters to be used for the theoretical
          distribution. For "norm" distribution, the parameters includes mean and variance.
  
      Returns
      -------
      A DataFrame that contains the Kolmogorov-Smirnov test result for the input sampled data.
      This DataFrame will contain a single Row with the following fields:
  
      - `pValue: Double`
      - `statistic: Double`
  
      Examples
      --------
      >>> from pyspark.ml.stat import KolmogorovSmirnovTest
      >>> dataset = [[-1.0], [0.0], [1.0]]
      >>> dataset = spark.createDataFrame(dataset, ['sample'])
      >>> ksResult = KolmogorovSmirnovTest.test(dataset, 'sample', 'norm', 0.0, 1.0).first()
      >>> round(ksResult.pValue, 3)
      1.0
      >>> round(ksResult.statistic, 3)
      0.175
      >>> dataset = [[2.0], [3.0], [4.0]]
      >>> dataset = spark.createDataFrame(dataset, ['sample'])
      >>> ksResult = KolmogorovSmirnovTest.test(dataset, 'sample', 'norm', 3.0, 1.0).first()
      >>> round(ksResult.pValue, 3)
      1.0
      >>> round(ksResult.statistic, 3)
      0.175
      """
      sc = SparkContext._active_spark_context
      assert sc is not None
  
      javaTestObj = (
          _jvm().org.apache.spark.ml.stat.KolmogorovSmirnovTest
      )
      dataset = _py2java(sc, dataset)
      params = [float(param) for param in params]  # type: ignore[assignment]
      return _java2py(
          sc,
          javaTestObj.test(
              dataset,
              sampleCol,
              distName,
              _jvm().PythonUtils.toSeq(params),
          ),
      )
  
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 1 for calling the KolmogorovSmirnovTest obj's underlying member method code with example usage: obj.test(dataset, sampleCol, distName) and returns: _java2py