Package smile.feature.selection
Class SumSquaresRatio
java.lang.Object
smile.feature.selection.SumSquaresRatio
- All Implemented Interfaces:
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.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(SumSquaresRatio other) static SumSquaresRatio[]
Calculates the sum squares ratio of numeric variables.toString()
-
Field Details
-
feature
The feature name. -
ssr
public final double ssrSum squares ratio.
-
-
Constructor Details
-
SumSquaresRatio
Constructor.- Parameters:
feature
- The feature name.ssr
- Sum squares ratio.
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in 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.
-