Record Class EMeans.Options

java.lang.Object
java.lang.Record
smile.clustering.EMeans.Options
Record Components:
k - the number of clusters (at least 2).
epochs - the number of training passes over the dataset (> 0, may be fractional such as 2.5).
batchLaw - the scaling law used to choose the batch size when batchSize == 0.
batchSize - manual batch size override, or 0 to derive from batchLaw.
alpha0 - manual initial EMA step size in (0, 1], or 0.0 to derive from the step scaling law.
unusedThreshold - dead-cluster revival threshold tau >= 0 (0.0 disables revival), or Double.NaN to choose automatically (0.0 when d <= 2, 0.1 when d > 2).
spherical - if true, keeps centroids on the unit sphere and assigns points by maximum inner product / cosine similarity.
controller - the optional training controller.
Enclosing class:
EMeans

public static record EMeans.Options(int k, double epochs, EMeans.BatchLaw batchLaw, int batchSize, double alpha0, double unusedThreshold, boolean spherical, IterativeAlgorithmController<AlgoStatus> controller) extends Record
E-Means clustering hyperparameters.
  • Constructor Details

    • Options

      public Options(int k, double epochs, EMeans.BatchLaw batchLaw, int batchSize, double alpha0, double unusedThreshold, boolean spherical, IterativeAlgorithmController<AlgoStatus> controller)
      Compact constructor with validation.
    • Options

      public Options(int k)
      Constructor with default 5 epochs and automatic scaling laws.
      Parameters:
      k - the number of clusters.
    • Options

      public Options(int k, double epochs)
      Constructor with automatic scaling laws.
      Parameters:
      k - the number of clusters.
      epochs - the number of training passes over the dataset.
    • Options

      public Options(int k, double epochs, EMeans.BatchLaw batchLaw)
      Constructor with explicit batch law.
      Parameters:
      k - the number of clusters.
      epochs - the number of training passes over the dataset.
      batchLaw - the batch scaling law.
  • Method Details

    • toProperties

      public Properties toProperties()
      Returns the persistent set of hyperparameters.
      Returns:
      the persistent set.
    • of

      public static EMeans.Options of(Properties props)
      Returns the options from properties.
      Parameters:
      props - the hyperparameters.
      Returns:
      the options.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • k

      public int k()
      Returns the value of the k record component.
      Returns:
      the value of the k record component
    • epochs

      public double epochs()
      Returns the value of the epochs record component.
      Returns:
      the value of the epochs record component
    • batchLaw

      public EMeans.BatchLaw batchLaw()
      Returns the value of the batchLaw record component.
      Returns:
      the value of the batchLaw record component
    • batchSize

      public int batchSize()
      Returns the value of the batchSize record component.
      Returns:
      the value of the batchSize record component
    • alpha0

      public double alpha0()
      Returns the value of the alpha0 record component.
      Returns:
      the value of the alpha0 record component
    • unusedThreshold

      public double unusedThreshold()
      Returns the value of the unusedThreshold record component.
      Returns:
      the value of the unusedThreshold record component
    • spherical

      public boolean spherical()
      Returns the value of the spherical record component.
      Returns:
      the value of the spherical record component
    • controller

      Returns the value of the controller record component.
      Returns:
      the value of the controller record component