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 as2.5).batchLaw- the scaling law used to choose the batch size whenbatchSize == 0.batchSize- manual batch size override, or0to derive frombatchLaw.alpha0- manual initial EMA step size in(0, 1], or0.0to derive from the step scaling law.unusedThreshold- dead-cluster revival thresholdtau >= 0(0.0disables revival), orDouble.NaNto choose automatically (0.0whend <= 2,0.1whend > 2).spherical- iftrue, 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 Summary
ConstructorsConstructorDescriptionOptions(int k) Constructor with default 5 epochs and automatic scaling laws.Options(int k, double epochs) Constructor with automatic scaling laws.Options(int k, double epochs, EMeans.BatchLaw batchLaw) Constructor with explicit batch law.Options(int k, double epochs, EMeans.BatchLaw batchLaw, int batchSize, double alpha0, double unusedThreshold, boolean spherical, IterativeAlgorithmController<AlgoStatus> controller) Compact constructor with validation. -
Method Summary
Modifier and TypeMethodDescriptiondoublealpha0()Returns the value of thealpha0record component.batchLaw()Returns the value of thebatchLawrecord component.intReturns the value of thebatchSizerecord component.Returns the value of thecontrollerrecord component.doubleepochs()Returns the value of theepochsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intk()Returns the value of thekrecord component.static EMeans.Optionsof(Properties props) Returns the options from properties.booleanReturns the value of thesphericalrecord component.Returns the persistent set of hyperparameters.final StringtoString()Returns a string representation of this record class.doubleReturns the value of theunusedThresholdrecord component.
-
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
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
Returns the persistent set of hyperparameters.- Returns:
- the persistent set.
-
of
Returns the options from properties.- Parameters:
props- the hyperparameters.- Returns:
- the options.
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
k
-
epochs
-
batchLaw
-
batchSize
-
alpha0
-
unusedThreshold
public double unusedThreshold()Returns the value of theunusedThresholdrecord component.- Returns:
- the value of the
unusedThresholdrecord component
-
spherical
-
controller
Returns the value of thecontrollerrecord component.- Returns:
- the value of the
controllerrecord component
-