class_docstr: K-fold cross validation performs model selection by splitting the dataset into a set of
  non-overlapping randomly partitioned folds which are used as separate training and test datasets
  e.g., with k=3 folds, K-fold cross validation will generate 3 (training, test) dataset pairs,
  each of which uses 2/3 of the data for training and 1/3 for testing. Each fold is used as the
  test set exactly once.
  
  .. versionadded:: 3.5.0
  
  Examples
  --------
  >>> from pyspark.ml.connect.tuning import CrossValidator
  >>> from pyspark.ml.connect.classification import LogisticRegression
  >>> from pyspark.ml.connect.evaluation import BinaryClassificationEvaluator
  >>> from pyspark.ml.tuning import ParamGridBuilder
  >>> from sklearn.datasets import load_breast_cancer
  >>> lor = LogisticRegression(maxIter=20, learningRate=0.01)
  >>> ev = BinaryClassificationEvaluator()
  >>> grid = ParamGridBuilder().addGrid(lor.maxIter, [2, 20]).build()
  >>> cv = CrossValidator(estimator=lor, evaluator=ev, estimatorParamMaps=grid)
  >>> sk_dataset = load_breast_cancer()
  >>> train_dataset = spark.createDataFrame(
  ...     zip(sk_dataset.data.tolist(), [int(t) for t in sk_dataset.target]),
  ...     schema="features: array<double>, label: long",
  ... )
  >>> cv_model = cv.fit(train_dataset)
  >>> transformed_dataset = cv_model.transform(train_dataset.limit(10))
  >>> cv_model.avgMetrics
  [0.5527792527167658, 0.8348714668615984]
  >>> cv_model.stdMetrics
  [0.04902833489813031, 0.05247132866444953]
class_docstr_tok: ["K-fold","cross","validation","performs","model","selection","by","splitting","the","dataset","into","a","set","of","non-overlapping","randomly","partitioned","folds","which","are","used","as","separate","training","and","test","datasets","e.g.",",","with","k=3","folds",",","K-fold","cross","validation","will","generate","3","(","training",",","test",")","dataset","pairs",",","each","of","which","uses","2\/3","of","the","data","for","training","and","1\/3","for","testing",".","Each","fold","is","used","as","the","test","set","exactly","once",".","..","versionadded",":",":","3.5.0","Examples","--","--","--","--",">",">",">","from","pyspark.ml.connect.tuning","import","CrossValidator",">",">",">","from","pyspark.ml.connect.classification","import","LogisticRegression",">",">",">","from","pyspark.ml.connect.evaluation","import","BinaryClassificationEvaluator",">",">",">","from","pyspark.ml.tuning","import","ParamGridBuilder",">",">",">","from","sklearn.datasets","import","load_breast_cancer",">",">",">","lor","=","LogisticRegression","(","maxIter=20",",","learningRate=0.01",")",">",">",">","ev","=","BinaryClassificationEvaluator","(",")",">",">",">","grid","=","ParamGridBuilder","(",")",".addGrid","(","lor.maxIter",",","[","2",",","20","]",")",".build","(",")",">",">",">","cv","=","CrossValidator","(","estimator=lor",",","evaluator=ev",",","estimatorParamMaps=grid",")",">",">",">","sk_dataset","=","load_breast_cancer","(",")",">",">",">","train_dataset","=","spark.createDataFrame","(","...","zip","(","sk_dataset.data.tolist","(",")",",","[","int","(","t",")","for","t","in","sk_dataset.target","]",")",",","...","schema=","''","features",":","array","<","double",">",",","label",":","long","''",",","...",")",">",">",">","cv_model","=","cv.fit","(","train_dataset",")",">",">",">","transformed_dataset","=","cv_model.transform","(","train_dataset.limit","(","10",")",")",">",">",">","cv_model.avgMetrics","[","0.5527792527167658",",","0.8348714668615984","]",">",">",">","cv_model.stdMetrics","[","0.04902833489813031",",","0.05247132866444953","]"]
docstr: Creates a copy of this instance with a randomly generated uid
  and some extra params. This copies creates a deep copy of
  the embedded paramMap, and copies the embedded and extra parameters over.
  
  
  .. versionadded:: 3.5.0
  
  Parameters
  ----------
  extra : dict, optional
      Extra parameters to copy to the new instance
  
  Returns
  -------
  :py:class:`CrossValidator`
      Copy of this instance
code: def copy(
      self, extra: Optional["ParamMap"] = None
  ) -> "CrossValidator":
      """
      Creates a copy of this instance with a randomly generated uid
      and some extra params. This copies creates a deep copy of
      the embedded paramMap, and copies the embedded and extra parameters over.
  
  
      .. versionadded:: 3.5.0
  
      Parameters
      ----------
      extra : dict, optional
          Extra parameters to copy to the new instance
  
      Returns
      -------
      :py:class:`CrossValidator`
          Copy of this instance
      """
      if extra is None:
          extra = dict()
      newCV = Params.copy(self, extra)
      if self.isSet(self.estimator):
          newCV.setEstimator(self.getEstimator().copy(extra))
      # estimatorParamMaps remain the same
      if self.isSet(self.evaluator):
          newCV.setEvaluator(self.getEvaluator().copy(extra))
      return newCV
  
imports: from multiprocessing.pool import ThreadPool
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union, cast, TYPE_CHECKING
  import numpy
  import pandas
  from pyspark import keyword_only, since, inheritable_thread_target
  from pyspark.ml.connect import Estimator, Model
  from pyspark.ml.connect.base import Evaluator
  from pyspark.ml.connect.io_utils import MetaAlgorithmReadWrite, ParamsReadWrite
  from pyspark.ml.param import Params, Param, TypeConverters
  from pyspark.ml.param.shared import HasParallelism, HasSeed
  from pyspark.sql.functions import col, lit, rand
  from pyspark.sql.dataframe import DataFrame
  from pyspark.sql import SparkSession
  from pyspark.sql.utils import is_remote
label_desc: Use image node_id 14 for calling the CrossValidator obj's underlying member method code with example usage: obj.copy(extra) and returns: newCV