public class Chi2FeatureSelection<OUTCOME_T> extends FeatureSelection<OUTCOME_T>
Modifier and Type | Class and Description |
---|---|
private static class |
Chi2FeatureSelection.Chi2Scorer<OUTCOME_T>
Helper class for aggregating and computing mutual Chi2 statistics
|
Modifier and Type | Field and Description |
---|---|
private Chi2FeatureSelection.Chi2Scorer<OUTCOME_T> |
chi2Function |
private double |
chi2Threshold |
private boolean |
yates |
isTrained, selectedFeatureNames
Constructor and Description |
---|
Chi2FeatureSelection(java.lang.String name) |
Chi2FeatureSelection(java.lang.String name,
double threshold) |
Chi2FeatureSelection(java.lang.String name,
double threshold,
boolean yates)
Constructor that can let use control the yate's correction
|
Modifier and Type | Method and Description |
---|---|
boolean |
apply(Feature feature) |
void |
load(java.net.URI uri) |
void |
save(java.net.URI uri) |
void |
train(java.lang.Iterable< |
getFeatureName, transform, transform
private double chi2Threshold
private Chi2FeatureSelection.Chi2Scorer<OUTCOME_T> chi2Function
private boolean yates
public Chi2FeatureSelection(java.lang.String name)
public Chi2FeatureSelection(java.lang.String name, double threshold)
public Chi2FeatureSelection(java.lang.String name, double threshold, boolean yates)
name
- threshold
- yates
- : true for using yate's correction, false for turn off yate's correctionpublic boolean apply(Feature feature)
apply
in class FeatureSelection<OUTCOME_T>
public void train(java.lang.Iterable<> instances)
public void save(java.net.URI uri) throws java.io.IOException
java.io.IOException
public void load(java.net.URI uri) throws java.io.IOException
java.io.IOException