Record Class SumSquaresRatio
java.lang.Object
java.lang.Record
smile.feature.selection.SumSquaresRatio
- Record Components:
feature- The feature name.ratio- Sum squares ratio.
- All Implemented Interfaces:
Comparable<SumSquaresRatio>
public record SumSquaresRatio(String feature, double ratio)
extends Record
implements Comparable<SumSquaresRatio>
The ratio of between-groups to within-groups sum of squares is a univariate
feature ranking metric, which can be used as a feature selection criterion
for multi-class classification problems. For each variable j, this ratio is
BSS(j) / WSS(j) = ΣI(yi = k)(xkj - x·j)2 / ΣI(yi = k)(xij - xkj)2;
where x·j denotes the average of variable j across all
samples, xkj denotes the average of variable j across samples
belonging to class k, and xij is the value of variable j of sample i.
Clearly, features with larger sum squares ratios are better for classification.
References
- S. Dudoit, J. Fridlyand and T. Speed. Comparison of discrimination methods for the classification of tumors using gene expression data. J Am Stat Assoc, 97:77-87, 2002.
-
Constructor Summary
ConstructorsConstructorDescriptionSumSquaresRatio(String feature, double ratio) Creates an instance of aSumSquaresRatiorecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(SumSquaresRatio other) final booleanIndicates whether some other object is "equal to" this one.feature()Returns the value of thefeaturerecord component.static SumSquaresRatio[]Calculates the sum squares 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
-
SumSquaresRatio
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<SumSquaresRatio>
-
toString
-
fit
Calculates the sum squares ratio of numeric variables.- Parameters:
data- the data frame of the explanatory and response variables.clazz- the column name of class labels.- Returns:
- the sum squares 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
-