class_docstr: K-means
  
  Performs k-means clustering on an H2O dataset.
class_docstr_tok: ["K-means","Performs","k-means","clustering","on","an","H2O","dataset","."]
docstr: :param model_id: Destination id for this model; auto-generated if not specified.
         Defaults to ``None``.
  :type model_id: Union[None, str, H2OEstimator], optional
  :param training_frame: Id of the training data frame.
         Defaults to ``None``.
  :type training_frame: Union[None, str, H2OFrame], optional
  :param validation_frame: Id of the validation data frame.
         Defaults to ``None``.
  :type validation_frame: Union[None, str, H2OFrame], optional
  :param nfolds: Number of folds for K-fold cross-validation (0 to disable or >= 2).
         Defaults to ``0``.
  :type nfolds: int
  :param keep_cross_validation_models: Whether to keep the cross-validation models.
         Defaults to ``True``.
  :type keep_cross_validation_models: bool
  :param keep_cross_validation_predictions: Whether to keep the predictions of the cross-validation models.
         Defaults to ``False``.
  :type keep_cross_validation_predictions: bool
  :param keep_cross_validation_fold_assignment: Whether to keep the cross-validation fold assignment.
         Defaults to ``False``.
  :type keep_cross_validation_fold_assignment: bool
  :param fold_assignment: Cross-validation fold assignment scheme, if fold_column is not specified. The
         'Stratified' option will stratify the folds based on the response variable, for classification problems.
         Defaults to ``"auto"``.
  :type fold_assignment: Literal["auto", "random", "modulo", "stratified"]
  :param fold_column: Column with cross-validation fold index assignment per observation.
         Defaults to ``None``.
  :type fold_column: str, optional
  :param ignored_columns: Names of columns to ignore for training.
         Defaults to ``None``.
  :type ignored_columns: List[str], optional
  :param ignore_const_cols: Ignore constant columns.
         Defaults to ``True``.
  :type ignore_const_cols: bool
  :param score_each_iteration: Whether to score during each iteration of model training.
         Defaults to ``False``.
  :type score_each_iteration: bool
  :param k: The max. number of clusters. If estimate_k is disabled, the model will find k centroids, otherwise it
         will find up to k centroids.
         Defaults to ``1``.
  :type k: int
  :param estimate_k: Whether to estimate the number of clusters (<=k) iteratively and deterministically.
         Defaults to ``False``.
  :type estimate_k: bool
  :param user_points: This option allows you to specify a dataframe, where each row represents an initial cluster
         center. The user-specified points must have the same number of columns as the training observations. The
         number of rows must equal the number of clusters
         Defaults to ``None``.
  :type user_points: Union[None, str, H2OFrame], optional
  :param max_iterations: Maximum training iterations (if estimate_k is enabled, then this is for each inner Lloyds
         iteration)
         Defaults to ``10``.
  :type max_iterations: int
  :param standardize: Standardize columns before computing distances
         Defaults to ``True``.
  :type standardize: bool
  :param seed: RNG Seed
         Defaults to ``-1``.
  :type seed: int
  :param init: Initialization mode
         Defaults to ``"furthest"``.
  :type init: Literal["random", "plus_plus", "furthest", "user"]
  :param max_runtime_secs: Maximum allowed runtime in seconds for model training. Use 0 to disable.
         Defaults to ``0.0``.
  :type max_runtime_secs: float
  :param categorical_encoding: Encoding scheme for categorical features
         Defaults to ``"auto"``.
  :type categorical_encoding: Literal["auto", "enum", "one_hot_internal", "one_hot_explicit", "binary", "eigen", "label_encoder",
         "sort_by_response", "enum_limited"]
  :param export_checkpoints_dir: Automatically export generated models to this directory.
         Defaults to ``None``.
  :type export_checkpoints_dir: str, optional
  :param cluster_size_constraints: An array specifying the minimum number of points that should be in each
         cluster. The length of the constraints array has to be the same as the number of clusters.
         Defaults to ``None``.
  :type cluster_size_constraints: List[int], optional
docstr_tok: [":","param","model_id",":","Destination","id","for","this","model",";","auto-generated","if","not","specified",".","Defaults","to","``","None","``",".",":","type","model_id",":","Union","[","None",",","str",",","H2OEstimator","]",",","optional",":","param","training_frame",":","Id","of","the","training","data","frame",".","Defaults","to","``","None","``",".",":","type","training_frame",":","Union","[","None",",","str",",","H2OFrame","]",",","optional",":","param","validation_frame",":","Id","of","the","validation","data","frame",".","Defaults","to","``","None","``",".",":","type","validation_frame",":","Union","[","None",",","str",",","H2OFrame","]",",","optional",":","param","nfolds",":","Number","of","folds","for","K-fold","cross-validation","(","0","to","disable","or",">","=","2",")",".","Defaults","to","``","0","``",".",":","type","nfolds",":","int",":","param","keep_cross_validation_models",":","Whether","to","keep","the","cross-validation","models",".","Defaults","to","``","True","``",".",":","type","keep_cross_validation_models",":","bool",":","param","keep_cross_validation_predictions",":","Whether","to","keep","the","predictions","of","the","cross-validation","models",".","Defaults","to","``","False","``",".",":","type","keep_cross_validation_predictions",":","bool",":","param","keep_cross_validation_fold_assignment",":","Whether","to","keep","the","cross-validation","fold","assignment",".","Defaults","to","``","False","``",".",":","type","keep_cross_validation_fold_assignment",":","bool",":","param","fold_assignment",":","Cross-validation","fold","assignment","scheme",",","if","fold_column","is","not","specified",".","The","'Stratified","'","option","will","stratify","the","folds","based","on","the","response","variable",",","for","classification","problems",".","Defaults","to","``","``","auto","''","``",".",":","type","fold_assignment",":","Literal","[","``","auto","''",",","``","random","''",",","``","modulo","''",",","``","stratified","''","]",":","param","fold_column",":","Column","with","cross-validation","fold","index","assignment","per","observation",".","Defaults","to","``","None","``",".",":","type","fold_column",":","str",",","optional",":","param","ignored_columns",":","Names","of","columns","to","ignore","for","training",".","Defaults","to","``","None","``",".",":","type","ignored_columns",":","List","[","str","]",",","optional",":","param","ignore_const_cols",":","Ignore","constant","columns",".","Defaults","to","``","True","``",".",":","type","ignore_const_cols",":","bool",":","param","score_each_iteration",":","Whether","to","score","during","each","iteration","of","model","training",".","Defaults","to","``","False","``",".",":","type","score_each_iteration",":","bool",":","param","k",":","The","max",".","number","of","clusters",".","If","estimate_k","is","disabled",",","the","model","will","find","k","centroids",",","otherwise","it","will","find","up","to","k","centroids",".","Defaults","to","``","1","``",".",":","type","k",":","int",":","param","estimate_k",":","Whether","to","estimate","the","number","of","clusters","(","<","=k",")","iteratively","and","deterministically",".","Defaults","to","``","False","``",".",":","type","estimate_k",":","bool",":","param","user_points",":","This","option","allows","you","to","specify","a","dataframe",",","where","each","row","represents","an","initial","cluster","center",".","The","user-specified","points","must","have","the","same","number","of","columns","as","the","training","observations",".","The","number","of","rows","must","equal","the","number","of","clusters","Defaults","to","``","None","``",".",":","type","user_points",":","Union","[","None",",","str",",","H2OFrame","]",",","optional",":","param","max_iterations",":","Maximum","training","iterations","(","if","estimate_k","is","enabled",",","then","this","is","for","each","inner","Lloyds","iteration",")","Defaults","to","``","10","``",".",":","type","max_iterations",":","int",":","param","standardize",":","Standardize","columns","before","computing","distances","Defaults","to","``","True","``",".",":","type","standardize",":","bool",":","param","seed",":","RNG","Seed","Defaults","to","``","-1","``",".",":","type","seed",":","int",":","param","init",":","Initialization","mode","Defaults","to","``","``","furthest","''","``",".",":","type","init",":","Literal","[","``","random","''",",","``","plus_plus","''",",","``","furthest","''",",","``","user","''","]",":","param","max_runtime_secs",":","Maximum","allowed","runtime","in","seconds","for","model","training",".","Use","0","to","disable",".","Defaults","to","``","0.0","``",".",":","type","max_runtime_secs",":","float",":","param","categorical_encoding",":","Encoding","scheme","for","categorical","features","Defaults","to","``","``","auto","''","``",".",":","type","categorical_encoding",":","Literal","[","``","auto","''",",","``","enum","''",",","``","one_hot_internal","''",",","``","one_hot_explicit","''",",","``","binary","''",",","``","eigen","''",",","``","label_encoder","''",",","``","sort_by_response","''",",","``","enum_limited","''","]",":","param","export_checkpoints_dir",":","Automatically","export","generated","models","to","this","directory",".","Defaults","to","``","None","``",".",":","type","export_checkpoints_dir",":","str",",","optional",":","param","cluster_size_constraints",":","An","array","specifying","the","minimum","number","of","points","that","should","be","in","each","cluster",".","The","length","of","the","constraints","array","has","to","be","the","same","as","the","number","of","clusters",".","Defaults","to","``","None","``",".",":","type","cluster_size_constraints",":","List","[","int","]",",","optional"]
code: def __init__(
      self,
      model_id=None,  # type: Optional[Union[None, str, H2OEstimator]]
      training_frame=None,  # type: Optional[Union[None, str, H2OFrame]]
      validation_frame=None,  # type: Optional[Union[None, str, H2OFrame]]
      nfolds=0,  # type: int
      keep_cross_validation_models=True,  # type: bool
      keep_cross_validation_predictions=False,  # type: bool
      keep_cross_validation_fold_assignment=False,  # type: bool
      fold_assignment="auto",  # type: Literal["auto", "random", "modulo", "stratified"]
      fold_column=None,  # type: Optional[str]
      ignored_columns=None,  # type: Optional[List[str]]
      ignore_const_cols=True,  # type: bool
      score_each_iteration=False,  # type: bool
      k=1,  # type: int
      estimate_k=False,  # type: bool
      user_points=None,  # type: Optional[Union[None, str, H2OFrame]]
      max_iterations=10,  # type: int
      standardize=True,  # type: bool
      seed=-1,  # type: int
      init="furthest",  # type: Literal["random", "plus_plus", "furthest", "user"]
      max_runtime_secs=0.0,  # type: float
      categorical_encoding="auto",  # type: Literal["auto", "enum", "one_hot_internal", "one_hot_explicit", "binary", "eigen", "label_encoder", "sort_by_response", "enum_limited"]
      export_checkpoints_dir=None,  # type: Optional[str]
      cluster_size_constraints=None,  # type: Optional[List[int]]
  ):
      """
      :param model_id: Destination id for this model; auto-generated if not specified.
             Defaults to ``None``.
      :type model_id: Union[None, str, H2OEstimator], optional
      :param training_frame: Id of the training data frame.
             Defaults to ``None``.
      :type training_frame: Union[None, str, H2OFrame], optional
      :param validation_frame: Id of the validation data frame.
             Defaults to ``None``.
      :type validation_frame: Union[None, str, H2OFrame], optional
      :param nfolds: Number of folds for K-fold cross-validation (0 to disable or >= 2).
             Defaults to ``0``.
      :type nfolds: int
      :param keep_cross_validation_models: Whether to keep the cross-validation models.
             Defaults to ``True``.
      :type keep_cross_validation_models: bool
      :param keep_cross_validation_predictions: Whether to keep the predictions of the cross-validation models.
             Defaults to ``False``.
      :type keep_cross_validation_predictions: bool
      :param keep_cross_validation_fold_assignment: Whether to keep the cross-validation fold assignment.
             Defaults to ``False``.
      :type keep_cross_validation_fold_assignment: bool
      :param fold_assignment: Cross-validation fold assignment scheme, if fold_column is not specified. The
             'Stratified' option will stratify the folds based on the response variable, for classification problems.
             Defaults to ``"auto"``.
      :type fold_assignment: Literal["auto", "random", "modulo", "stratified"]
      :param fold_column: Column with cross-validation fold index assignment per observation.
             Defaults to ``None``.
      :type fold_column: str, optional
      :param ignored_columns: Names of columns to ignore for training.
             Defaults to ``None``.
      :type ignored_columns: List[str], optional
      :param ignore_const_cols: Ignore constant columns.
             Defaults to ``True``.
      :type ignore_const_cols: bool
      :param score_each_iteration: Whether to score during each iteration of model training.
             Defaults to ``False``.
      :type score_each_iteration: bool
      :param k: The max. number of clusters. If estimate_k is disabled, the model will find k centroids, otherwise it
             will find up to k centroids.
             Defaults to ``1``.
      :type k: int
      :param estimate_k: Whether to estimate the number of clusters (<=k) iteratively and deterministically.
             Defaults to ``False``.
      :type estimate_k: bool
      :param user_points: This option allows you to specify a dataframe, where each row represents an initial cluster
             center. The user-specified points must have the same number of columns as the training observations. The
             number of rows must equal the number of clusters
             Defaults to ``None``.
      :type user_points: Union[None, str, H2OFrame], optional
      :param max_iterations: Maximum training iterations (if estimate_k is enabled, then this is for each inner Lloyds
             iteration)
             Defaults to ``10``.
      :type max_iterations: int
      :param standardize: Standardize columns before computing distances
             Defaults to ``True``.
      :type standardize: bool
      :param seed: RNG Seed
             Defaults to ``-1``.
      :type seed: int
      :param init: Initialization mode
             Defaults to ``"furthest"``.
      :type init: Literal["random", "plus_plus", "furthest", "user"]
      :param max_runtime_secs: Maximum allowed runtime in seconds for model training. Use 0 to disable.
             Defaults to ``0.0``.
      :type max_runtime_secs: float
      :param categorical_encoding: Encoding scheme for categorical features
             Defaults to ``"auto"``.
      :type categorical_encoding: Literal["auto", "enum", "one_hot_internal", "one_hot_explicit", "binary", "eigen", "label_encoder",
             "sort_by_response", "enum_limited"]
      :param export_checkpoints_dir: Automatically export generated models to this directory.
             Defaults to ``None``.
      :type export_checkpoints_dir: str, optional
      :param cluster_size_constraints: An array specifying the minimum number of points that should be in each
             cluster. The length of the constraints array has to be the same as the number of clusters.
             Defaults to ``None``.
      :type cluster_size_constraints: List[int], optional
      """
      super(H2OKMeansEstimator, self).__init__()
      self._parms = {}
      self._id = self._parms["model_id"] = model_id
      self.training_frame = training_frame
      self.validation_frame = validation_frame
      self.nfolds = nfolds
      self.keep_cross_validation_models = keep_cross_validation_models
      self.keep_cross_validation_predictions = (
          keep_cross_validation_predictions
      )
      self.keep_cross_validation_fold_assignment = (
          keep_cross_validation_fold_assignment
      )
      self.fold_assignment = fold_assignment
      self.fold_column = fold_column
      self.ignored_columns = ignored_columns
      self.ignore_const_cols = ignore_const_cols
      self.score_each_iteration = score_each_iteration
      self.k = k
      self.estimate_k = estimate_k
      self.user_points = user_points
      self.max_iterations = max_iterations
      self.standardize = standardize
      self.seed = seed
      self.init = init
      self.max_runtime_secs = max_runtime_secs
      self.categorical_encoding = categorical_encoding
      self.export_checkpoints_dir = export_checkpoints_dir
      self.cluster_size_constraints = cluster_size_constraints
  
imports: from h2o.estimators.estimator_base import H2OEstimator
  from h2o.exceptions import H2OValueError
  from h2o.frame import H2OFrame
  from h2o.utils.typechecks import assert_is_type, Enum, numeric
label_desc: Use image node_id 1 to create a new H2OKMeansEstimator object from inherited base classes: H2OEstimator with example: obj = H2OKMeansEstimator(model_id, training_frame, validation_frame, nfolds, keep_cross_validation_models, keep_cross_validation_predictions, keep_cross_validation_fold_assignment, fold_assignment, fold_column, ignored_columns, ignore_const_cols, score_each_iteration, k, estimate_k, user_points, max_iterations, standardize, seed, init, max_runtime_secs, categorical_encoding, export_checkpoints_dir, cluster_size_constraints)