Record Class ADASYN.Options

java.lang.Object
java.lang.Record
smile.classification.resampling.ADASYN.Options
Record Components:
k - the number of nearest neighbors used to compute the local density ratio (typically 5).
ratio - controls the desired level of synthetic data generation. The total number of synthetic samples is G = (|majority| - |minority|) * ratio. A value of 1.0 attempts full balancing. Must be in (0, 1].
highDimThreshold - the dimensionality threshold above which RandomProjectionForest is used instead of KDTree for k-NN search.
rpfNumTrees - number of trees in the RandomProjectionForest.
rpfLeafSize - maximum leaf size for the RandomProjectionForest.
Enclosing class:
ADASYN

public static record ADASYN.Options(int k, double ratio, int highDimThreshold, int rpfNumTrees, int rpfLeafSize) extends Record
ADASYN hyperparameters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor: k=5, ratio=1.0, highDimThreshold=20, rpfNumTrees=10, rpfLeafSize=30.
    Options(int k, double ratio)
    Constructor with default index parameters.
    Options(int k, double ratio, int highDimThreshold, int rpfNumTrees, int rpfLeafSize)
    Compact constructor with validation.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the highDimThreshold record component.
    int
    k()
    Returns the value of the k record component.
    of(Properties props)
    Returns the options from properties.
    double
    Returns the value of the ratio record component.
    int
    Returns the value of the rpfLeafSize record component.
    int
    Returns the value of the rpfNumTrees record component.
    Returns the persistent set of hyperparameters including smile.adasyn.k smile.adasyn.ratio smile.adasyn.high_dim_threshold smile.adasyn.rpf_num_trees smile.adasyn.rpf_leaf_size
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Options

      public Options()
      Default constructor: k=5, ratio=1.0, highDimThreshold=20, rpfNumTrees=10, rpfLeafSize=30.
    • Options

      public Options(int k, double ratio)
      Constructor with default index parameters.
      Parameters:
      k - number of nearest neighbors.
      ratio - target imbalance ratio.
    • Options

      public Options(int k, double ratio, int highDimThreshold, int rpfNumTrees, int rpfLeafSize)
      Compact constructor with validation.
  • Method Details

    • toProperties

      public Properties toProperties()
      Returns the persistent set of hyperparameters including
      • smile.adasyn.k
      • smile.adasyn.ratio
      • smile.adasyn.high_dim_threshold
      • smile.adasyn.rpf_num_trees
      • smile.adasyn.rpf_leaf_size
      Returns:
      the persistent set.
    • of

      public static ADASYN.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. All components in this record class 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
    • ratio

      public double ratio()
      Returns the value of the ratio record component.
      Returns:
      the value of the ratio record component
    • highDimThreshold

      public int highDimThreshold()
      Returns the value of the highDimThreshold record component.
      Returns:
      the value of the highDimThreshold record component
    • rpfNumTrees

      public int rpfNumTrees()
      Returns the value of the rpfNumTrees record component.
      Returns:
      the value of the rpfNumTrees record component
    • rpfLeafSize

      public int rpfLeafSize()
      Returns the value of the rpfLeafSize record component.
      Returns:
      the value of the rpfLeafSize record component