smile.feature
Class SumSquaresRatio
- java.lang.Object
-
- smile.feature.SumSquaresRatio
-
- All Implemented Interfaces:
- FeatureRanking
public class SumSquaresRatio extends java.lang.Object implements FeatureRanking
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
Constructors Constructor and Description SumSquaresRatio()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]rank(double[][] x, int[] y)Univariate feature ranking.
-
-
-
Method Detail
-
rank
public double[] rank(double[][] x, int[] y)Description copied from interface:FeatureRankingUnivariate feature ranking. Note that this method actually does NOT rank the features. It just returns the metric values of each feature. The caller can then rank and select features.- Specified by:
rankin interfaceFeatureRanking- Parameters:
x- a n-by-p matrix of n instances with p features.y- class labels in [0, k), where k is the number of classes.- Returns:
- the metric values of each feature.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG