Record Class BSO.Options

java.lang.Object
java.lang.Record
smile.classification.resampling.BSO.Options
Record Components:
m - neighborhood size used to classify each minority sample as NOISE / DANGER / SAFE. Typical value: 5.
kMaj - number of nearest majority neighbors used to compute the shift centroid. Typical value: 3. When 0, the shifting mechanism is disabled and the algorithm falls back to standard Borderline-SMOTE interpolation.
alpha - shift factor α ∈ (0, 1) — proportion of the vector from seed to majority centroid to traverse when placing a synthetic sample. Smaller values keep synthetics closer to the minority side.
ratio - over-sampling ratio relative to the minority class size. 1.0 doubles the minority class. Must be positive.
strategy - BSO.Strategy.DANGER or BSO.Strategy.DANGER_AND_SAFE.
highDimThreshold - the dimensionality threshold above which RandomProjectionForest is used instead of KDTree.
rpfNumTrees - number of trees in the RandomProjectionForest.
rpfLeafSize - maximum leaf size for the RandomProjectionForest.
Enclosing class:
BSO

public static record BSO.Options(int m, int kMaj, double alpha, double ratio, BSO.Strategy strategy, int highDimThreshold, int rpfNumTrees, int rpfLeafSize) extends Record
BSO hyperparameters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor: m=5, kMaj=3, alpha=0.2, ratio=1.0, strategy=DANGER, highDimThreshold=20, rpfNumTrees=10, rpfLeafSize=30.
    Options(int m, int kMaj, double alpha, double ratio, BSO.Strategy variant)
    Constructor with core parameters and default index / dimension settings.
    Options(int m, int kMaj, double alpha, double ratio, BSO.Strategy strategy, int highDimThreshold, int rpfNumTrees, int rpfLeafSize)
    Compact constructor with validation.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the alpha record component.
    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
    Returns the value of the kMaj record component.
    int
    m()
    Returns the value of the m 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 value of the strategy record component.
    Returns the persistent set of hyperparameters including smile.bso.m smile.bso.k_maj smile.bso.alpha smile.bso.ratio smile.bso.strategy smile.bso.high_dim_threshold smile.bso.rpf_num_trees smile.bso.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: m=5, kMaj=3, alpha=0.2, ratio=1.0, strategy=DANGER, highDimThreshold=20, rpfNumTrees=10, rpfLeafSize=30.
    • Options

      public Options(int m, int kMaj, double alpha, double ratio, BSO.Strategy variant)
      Constructor with core parameters and default index / dimension settings.
      Parameters:
      m - neighborhood size for borderline classification.
      kMaj - number of majority neighbors for shift centroid.
      alpha - shift factor.
      ratio - over-sampling ratio.
      variant - BSO strategy.
    • Options

      public Options(int m, int kMaj, double alpha, double ratio, BSO.Strategy strategy, int highDimThreshold, int rpfNumTrees, int rpfLeafSize)
      Compact constructor with validation.
  • Method Details

    • toProperties

      public Properties toProperties()
      Returns the persistent set of hyperparameters including
      • smile.bso.m
      • smile.bso.k_maj
      • smile.bso.alpha
      • smile.bso.ratio
      • smile.bso.strategy
      • smile.bso.high_dim_threshold
      • smile.bso.rpf_num_trees
      • smile.bso.rpf_leaf_size
      Returns:
      the persistent set.
    • of

      public static BSO.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.
    • m

      public int m()
      Returns the value of the m record component.
      Returns:
      the value of the m record component
    • kMaj

      public int kMaj()
      Returns the value of the kMaj record component.
      Returns:
      the value of the kMaj record component
    • alpha

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

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

      public BSO.Strategy strategy()
      Returns the value of the strategy record component.
      Returns:
      the value of the strategy 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