Returns a ChiSquared feature selector.
Returns a ChiSquared feature selector.
an RDD[LabeledPoint] containing the labeled dataset with categorical features.
Real-valued features will be treated as categorical for each distinct value.
Apply feature discretizer before using this function.
Creates a ChiSquared feature selector. The selector supports different selection methods:
numTopFeatures,percentile,fpr,fdr,fwe.numTopFeatureschooses a fixed number of top features according to a chi-squared test.percentileis similar but chooses a fraction of all features instead of a fixed number.fprchooses all features whose p-values are below a threshold, thus controlling the false positive rate of selection.fdruses the [Benjamini-Hochberg procedure] (https://en.wikipedia.org/wiki/False_discovery_rate#Benjamini.E2.80.93Hochberg_procedure) to choose all features whose false discovery rate is below a threshold.fwechooses all features whose p-values are below a threshold. The threshold is scaled by 1/numFeatures, thus controlling the family-wise error rate of selection. By default, the selection method isnumTopFeatures, with the default number of top features set to 50.