Documentation of 'smile.feature.GAFeatureSelection' Java class
GAFeatureSelection
smile.feature

Class GAFeatureSelection



  • public class GAFeatureSelection
    extends java.lang.Object
    Genetic algorithm based feature selection. This method finds many (random) subsets of variables of expected classification power using a Genetic Algorithm. The "fitness" of each subset of variables is determined by its ability to classify the samples according to a given classification method. When many such subsets of variables are obtained, the one with best performance may be used as selected features. Alternatively, the frequencies with which variables are selected may be analyzed further. The most frequently selected variables may be presumed to be the most relevant to sample distinction and are finally used for prediction. Although GA avoids brute-force search, it is still much slower than univariate feature selection.

    References

    1. Leping Li and Clarice R. Weinberg. Gene Selection and Sample Classification Using a Genetic Algorithm/k-Nearest Neighbor Method.
    • Constructor Detail

      • GAFeatureSelection

        public GAFeatureSelection()
        Constructor.
      • GAFeatureSelection

        public GAFeatureSelection(GeneticAlgorithm.Selection selection,
                                  BitString.Crossover crossover,
                                  double crossoverRate,
                                  double mutationRate)
        Constructor.
        Parameters:
        selection - the selection strategy.
        crossover - the strategy of crossover operation.
        crossoverRate - the crossover rate.
        mutationRate - the mutation rate.
    • Method Detail

      • learn

        public BitString[] learn(int size,
                                 int generation,
                                 ClassifierTrainer<double[]> trainer,
                                 ClassificationMeasure measure,
                                 double[][] x,
                                 int[] y,
                                 int k)
        Genetic algorithm based feature selection for classification.
        Parameters:
        size - the population size of Genetic Algorithm.
        generation - the maximum number of iterations.
        trainer - classifier trainer.
        measure - classification measure as the chromosome fitness measure.
        x - training instances.
        y - training labels.
        k - k-fold cross validation for the evaluation.
        Returns:
        bit strings of last generation.
      • learn

        public BitString[] learn(int size,
                                 int generation,
                                 ClassifierTrainer<double[]> trainer,
                                 ClassificationMeasure measure,
                                 double[][] x,
                                 int[] y,
                                 double[][] testx,
                                 int[] testy)
        Genetic algorithm based feature selection for classification.
        Parameters:
        size - the population size of Genetic Algorithm.
        generation - the maximum number of iterations.
        trainer - classifier trainer.
        measure - classification measure as the chromosome fitness measure.
        x - training instances.
        y - training instance labels.
        testx - testing instances.
        testy - testing instance labels.
        Returns:
        bit strings of last generation.
      • learn

        public BitString[] learn(int size,
                                 int generation,
                                 RegressionTrainer<double[]> trainer,
                                 RegressionMeasure measure,
                                 double[][] x,
                                 double[] y,
                                 int k)
        Genetic algorithm based feature selection for regression.
        Parameters:
        size - the population size of Genetic Algorithm.
        generation - the maximum number of iterations.
        trainer - regression model trainer.
        measure - classification measure as the chromosome fitness measure.
        x - training instances.
        y - training instance response variable.
        k - k-fold cross validation for the evaluation.
        Returns:
        bit strings of last generation.
      • learn

        public BitString[] learn(int size,
                                 int generation,
                                 RegressionTrainer<double[]> trainer,
                                 RegressionMeasure measure,
                                 double[][] x,
                                 double[] y,
                                 double[][] testx,
                                 double[] testy)
        Genetic algorithm based feature selection for regression.
        Parameters:
        size - the population size of Genetic Algorithm.
        generation - the maximum number of iterations.
        trainer - regression model trainer.
        measure - classification measure as the chromosome fitness measure.
        x - training instances.
        y - training instance response variable.
        testx - testing instances.
        testy - testing instance labels.
        Returns:
        bit strings of last generation.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.