class_docstr: !
  @brief Class implements G-Means clustering algorithm.
  @details The G-means algorithm starts with a small number of centers, and grows the number of centers.
            Each iteration of the G-Means algorithm splits into two those centers whose data appear not to come from a
            Gaussian distribution. G-means repeatedly makes decisions based on a statistical test for the data
            assigned to each center.
  
  Implementation based on the paper @cite inproceedings::cluster::gmeans::1.
  
  @image html gmeans_example_clustering.png "G-Means clustering results on most common data-sets."
  
  Example #1. In this example, G-Means starts analysis from single cluster.
  @code
      from pyclustering.cluster import cluster_visualizer
      from pyclustering.cluster.gmeans import gmeans
      from pyclustering.utils import read_sample
      from pyclustering.samples.definitions import FCPS_SAMPLES
  
      # Read sample 'Lsun' from file.
      sample = read_sample(FCPS_SAMPLES.SAMPLE_LSUN)
  
      # Create instance of G-Means algorithm. By default the algorithm starts search from a single cluster.
      gmeans_instance = gmeans(sample).process()
  
      # Extract clustering results: clusters and their centers
      clusters = gmeans_instance.get_clusters()
      centers = gmeans_instance.get_centers()
  
      # Print total sum of metric errors
      print("Total WCE:", gmeans_instance.get_total_wce())
  
      # Visualize clustering results
      visualizer = cluster_visualizer()
      visualizer.append_clusters(clusters, sample)
      visualizer.show()
  @endcode
  
  Example #2. Sometimes G-Means might find local optimum. `repeat` value can be used to increase probability to
  find global optimum. Argument `repeat` defines how many times K-Means clustering with K-Means++
  initialization should be run in order to find optimal clusters.
  @code
      # Read sample 'Tetra' from file.
      sample = read_sample(FCPS_SAMPLES.SAMPLE_TETRA)
  
      # Create instance of G-Means algorithm. By default algorithm start search from single cluster.
      gmeans_instance = gmeans(sample, repeat=10).process()
  
      # Extract clustering results: clusters and their centers
      clusters = gmeans_instance.get_clusters()
  
      # Visualize clustering results
      visualizer = cluster_visualizer()
      visualizer.append_clusters(clusters, sample)
      visualizer.show()
  @endcode
  
  In case of requirement to have labels instead of default representation of clustering results `CLUSTER_INDEX_LIST_SEPARATION`:
  @code
      from pyclustering.cluster.gmeans import gmeans
      from pyclustering.cluster.encoder import type_encoding, cluster_encoder
      from pyclustering.samples.definitions import SIMPLE_SAMPLES
      from pyclustering.utils import read_sample
  
      data = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE1)
  
      gmeans_instance = gmeans(data).process()
      clusters = gmeans_instance.get_clusters()
  
      # Change cluster representation from default to labeling.
      encoder = cluster_encoder(type_encoding.CLUSTER_INDEX_LIST_SEPARATION, clusters, data)
      encoder.set_encoding(type_encoding.CLUSTER_INDEX_LABELING)
      labels = encoder.get_clusters()
  
      print(labels)   # Display labels
  @endcode
  
  There is an output of the code above:
  @code
      [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
  @endcode
class_docstr_tok: ["!","@","brief","Class","implements","G-Means","clustering","algorithm",".","@","details","The","G-means","algorithm","starts","with","a","small","number","of","centers",",","and","grows","the","number","of","centers",".","Each","iteration","of","the","G-Means","algorithm","splits","into","two","those","centers","whose","data","appear","not","to","come","from","a","Gaussian","distribution",".","G-means","repeatedly","makes","decisions","based","on","a","statistical","test","for","the","data","assigned","to","each","center",".","Implementation","based","on","the","paper","@","cite","inproceedings",":",":cluster",":",":gmeans",":",":1",".","@","image","html","gmeans_example_clustering.png","``","G-Means","clustering","results","on","most","common","data-sets",".","''","Example","#","1",".","In","this","example",",","G-Means","starts","analysis","from","single","cluster",".","@","code","from","pyclustering.cluster","import","cluster_visualizer","from","pyclustering.cluster.gmeans","import","gmeans","from","pyclustering.utils","import","read_sample","from","pyclustering.samples.definitions","import","FCPS_SAMPLES","#","Read","sample","'Lsun","'","from","file",".","sample","=","read_sample","(","FCPS_SAMPLES.SAMPLE_LSUN",")","#","Create","instance","of","G-Means","algorithm",".","By","default","the","algorithm","starts","search","from","a","single","cluster",".","gmeans_instance","=","gmeans","(","sample",")",".process","(",")","#","Extract","clustering","results",":","clusters","and","their","centers","clusters","=","gmeans_instance.get_clusters","(",")","centers","=","gmeans_instance.get_centers","(",")","#","Print","total","sum","of","metric","errors","print","(","``","Total","WCE",":","''",",","gmeans_instance.get_total_wce","(",")",")","#","Visualize","clustering","results","visualizer","=","cluster_visualizer","(",")","visualizer.append_clusters","(","clusters",",","sample",")","visualizer.show","(",")","@","endcode","Example","#","2",".","Sometimes","G-Means","might","find","local","optimum",".","`","repeat","`","value","can","be","used","to","increase","probability","to","find","global","optimum",".","Argument","`","repeat","`","defines","how","many","times","K-Means","clustering","with","K-Means++","initialization","should","be","run","in","order","to","find","optimal","clusters",".","@","code","#","Read","sample","'Tetra","'","from","file",".","sample","=","read_sample","(","FCPS_SAMPLES.SAMPLE_TETRA",")","#","Create","instance","of","G-Means","algorithm",".","By","default","algorithm","start","search","from","single","cluster",".","gmeans_instance","=","gmeans","(","sample",",","repeat=10",")",".process","(",")","#","Extract","clustering","results",":","clusters","and","their","centers","clusters","=","gmeans_instance.get_clusters","(",")","#","Visualize","clustering","results","visualizer","=","cluster_visualizer","(",")","visualizer.append_clusters","(","clusters",",","sample",")","visualizer.show","(",")","@","endcode","In","case","of","requirement","to","have","labels","instead","of","default","representation","of","clustering","results","`","CLUSTER_INDEX_LIST_SEPARATION","`",":","@","code","from","pyclustering.cluster.gmeans","import","gmeans","from","pyclustering.cluster.encoder","import","type_encoding",",","cluster_encoder","from","pyclustering.samples.definitions","import","SIMPLE_SAMPLES","from","pyclustering.utils","import","read_sample","data","=","read_sample","(","SIMPLE_SAMPLES.SAMPLE_SIMPLE1",")","gmeans_instance","=","gmeans","(","data",")",".process","(",")","clusters","=","gmeans_instance.get_clusters","(",")","#","Change","cluster","representation","from","default","to","labeling",".","encoder","=","cluster_encoder","(","type_encoding.CLUSTER_INDEX_LIST_SEPARATION",",","clusters",",","data",")","encoder.set_encoding","(","type_encoding.CLUSTER_INDEX_LABELING",")","labels","=","encoder.get_clusters","(",")","print","(","labels",")","#","Display","labels","@","endcode","There","is","an","output","of","the","code","above",":","@","code","[","0",",","0",",","0",",","0",",","0",",","1",",","1",",","1",",","1",",","1","]","@","endcode"]
docstr: !
  @brief Verify input parameters for the algorithm and throw exception in case of incorrectness.
docstr_tok: ["!","@","brief","Verify","input","parameters","for","the","algorithm","and","throw","exception","in","case","of","incorrectness","."]
code: def _verify_arguments(self):
      """!
      @brief Verify input parameters for the algorithm and throw exception in case of incorrectness.
  
      """
      if len(self.__data) == 0:
          raise ValueError(
              "Input data is empty (size: '%d')." % len(self.__data)
          )
  
      if self.__k_init <= 0:
          raise ValueError(
              "Initial amount of centers should be greater than 0 "
              "(current value: '%d')." % self.__k_init
          )
  
      if self.__tolerance <= 0.0:
          raise ValueError(
              "Tolerance should be greater than 0 (current value: '%f')."
              % self.__tolerance
          )
  
      if self.__repeat <= 0:
          raise ValueError(
              "Amount of attempt to find optimal parameters should be greater than 0 "
              "(current value: '%d')." % self.__repeat
          )
  
      if (self.__k_max != -1) and (self.__k_max <= 0):
          raise ValueError(
              "Maximum amount of cluster that might be allocated should be greater than 0 or -1 if "
              "the algorithm should be restricted in searching optimal number of clusters."
          )
  
      if (self.__k_max != -1) and (self.__k_max < self.__k_init):
          raise ValueError(
              "Initial amount of clusters should be less than the maximum amount 'k_max'."
          )
  
imports: import numpy
  import scipy.stats
  from pyclustering.core.gmeans_wrapper import gmeans
  from pyclustering.core.wrapper import ccore_library
  from pyclustering.cluster.center_initializer import kmeans_plusplus_initializer
  from pyclustering.cluster.encoder import type_encoding
  from pyclustering.cluster.kmeans import kmeans
  from pyclustering.utils import distance_metric, type_metric
label_desc: Use image node_id 17 for calling the gmeans obj's underlying member method code with example usage: obj._verify_arguments() without return types