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) 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
- M. Shipp, et al. Diffuse large B-cell lymphoma outcome prediction by gene-expression profiling and supervised machine learning. Nature Medicine, 2002.
-
Constructor Summary
ConstructorsConstructorDescriptionSignalNoiseRatio(String feature, double ratio) Creates an instance of aSignalNoiseRatiorecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(SignalNoiseRatio other) final booleanIndicates whether some other object is "equal to" this one.feature()Returns the value of thefeaturerecord component.static SignalNoiseRatio[]Calculates the signal noise ratio of numeric variables.final inthashCode()Returns a hash code value for this object.doubleratio()Returns the value of theratiorecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
SignalNoiseRatio
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<SignalNoiseRatio>
-
toString
-
fit
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
-
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. -
feature
-
ratio
-