Record Class SignalNoiseRatio

java.lang.Object
java.lang.Record
smile.feature.selection.SignalNoiseRatio
Record Components:
feature - The feature name.
ratio - Signal noise ratio.
All Implemented Interfaces:
Comparable<SignalNoiseRatio>

public record SignalNoiseRatio(String feature, double ratio) extends Record implements Comparable<SignalNoiseRatio>
The signal-to-noise (S2N) metric ratio is a univariate feature ranking metric, which can be used as a feature selection criterion for binary classification problems. S2N is defined as |μ1 - μ2| / (σ1 + σ2), where μ1 and μ2 are the mean value of the variable in classes 1 and 2, respectively, and σ1 and σ2 are the standard deviations of the variable in classes 1 and 2, respectively. Clearly, features with larger S2N ratios are better for classification.

References

  1. M. Shipp, et al. Diffuse large B-cell lymphoma outcome prediction by gene-expression profiling and supervised machine learning. Nature Medicine, 2002.
  • Constructor Details

    • SignalNoiseRatio

      public SignalNoiseRatio(String feature, double ratio)
      Creates an instance of a SignalNoiseRatio record class.
      Parameters:
      feature - the value for the feature record component
      ratio - the value for the ratio record component
  • Method Details

    • compareTo

      public int compareTo(SignalNoiseRatio other)
      Specified by:
      compareTo in interface Comparable<SignalNoiseRatio>
    • toString

      public 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
    • fit

      public static SignalNoiseRatio[] fit(DataFrame data, String clazz)
      Calculates the signal noise ratio of numeric variables.
      Parameters:
      data - the data frame of the explanatory and response variables.
      clazz - the column name of binary class labels.
      Returns:
      the signal noise ratio.
    • 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 '=='.
      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.
    • feature

      public String feature()
      Returns the value of the feature record component.
      Returns:
      the value of the feature record component
    • ratio

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