class_docstr: First come clustering creates a new cluster for each new vector
  that is far enough from the clusters already existing.
  
  :param min_vector_count: the smallest number of vectors in a cluster to consider that the variance is valid.
  :type min_vector_count: int, > 0, default=4
  
  :param default_variance: the default variance (for when the number of vectors is smaller than min_vector_count).
  :type default_variance: float, default=1.0
  
  :param threshold: the distance threshold for creating a new cluster.
  :type threshold: float, default=0.0
  
  :param min_cluster_size_ratio: the minimum ratio of the number elements in a cluster to the total number of vectors.
  :type min_cluster_size_ratio: float, default=0.05
  
  :param max_cluster_count: the maximum number of clusters to prevent algorithm divergence
      in case of great differences in data.
  :type max_cluster_count: int, default=100
  
  :param distance: the distance function to measure cluster size.
  :type distance: str, {'euclid', 'machalanobis', 'cosine'}, default='euclid'
class_docstr_tok: ["First","come","clustering","creates","a","new","cluster","for","each","new","vector","that","is","far","enough","from","the","clusters","already","existing",".",":","param","min_vector_count",":","the","smallest","number","of","vectors","in","a","cluster","to","consider","that","the","variance","is","valid",".",":","type","min_vector_count",":","int",",",">","0",",","default=4",":","param","default_variance",":","the","default","variance","(","for","when","the","number","of","vectors","is","smaller","than","min_vector_count",")",".",":","type","default_variance",":","float",",","default=1.0",":","param","threshold",":","the","distance","threshold","for","creating","a","new","cluster",".",":","type","threshold",":","float",",","default=0.0",":","param","min_cluster_size_ratio",":","the","minimum","ratio","of","the","number","elements","in","a","cluster","to","the","total","number","of","vectors",".",":","type","min_cluster_size_ratio",":","float",",","default=0.05",":","param","max_cluster_count",":","the","maximum","number","of","clusters","to","prevent","algorithm","divergence","in","case","of","great","differences","in","data",".",":","type","max_cluster_count",":","int",",","default=100",":","param","distance",":","the","distance","function","to","measure","cluster","size",".",":","type","distance",":","str",",","{","'euclid","'",",","'machalanobis","'",",","'cosine","'","}",",","default='euclid","'"]
code: def __init__(
      self,
      min_vector_count=4,
      default_variance=1.0,
      threshold=0.0,
      min_cluster_size_ratio=0.05,
      max_cluster_count=100,
      distance="euclid",
  ):
      if (
          distance != "euclid"
          and distance != "machalanobis"
          and distance != "cosine"
      ):
          raise ValueError(
              "The `distance` must be one of {`euclid`, `machalanobis`, `cosine`}."
          )
      if max_cluster_count <= 0:
          raise ValueError("The `max_cluster_count` must be > 0.")
      if min_cluster_size_ratio > 1 or min_cluster_size_ratio < 0:
          raise ValueError(
              "The `min_cluster_size_ratio` must be in [0, 1]."
          )
  
      super().__init__(
          distance,
          int(min_vector_count),
          float(default_variance),
          float(threshold),
          float(min_cluster_size_ratio),
          int(max_cluster_count),
      )
  
file_path: neoml/NeoML/Python/neoml/Clustering.py
imports: import numpy
  from .Utils import convert_data, get_data
  from scipy.sparse import csr_matrix
  import neoml.PythonWrapper
label_desc: Use image node_id 1 to create a new FirstCome object from inherited base classes: PythonWrapper with example: obj = FirstCome(min_vector_count, default_variance, threshold, min_cluster_size_ratio, max_cluster_count, distance)