Class FitnessEvaluator

java.lang.Object
unifeat.featureSelection.FitnessEvaluator

public class FitnessEvaluator extends Object
This java class is used to implement fitness evaluator of a solution in which k-fold cross validation on training set is used for evaluating the classification performance of a selected feature subset.
Author:
Sina Tabakhi
See Also:
  • Field Details

    • TEMP_PATH

      private final String TEMP_PATH
    • trainSet

      private double[][] trainSet
    • nameFeatures

      private String[] nameFeatures
    • classLabel

      private String[] classLabel
    • selectedEvaluationClassifierPanel

      private Object selectedEvaluationClassifierPanel
    • classifierType

      private ClassifierType classifierType
    • kFolds

      private int kFolds
  • Constructor Details

    • FitnessEvaluator

      public FitnessEvaluator(String path, Object classifierName, Object selectedEvaluationClassifierPanel, int kFolds)
      Initializes the parameters
      Parameters:
      path - the temp path in the project
      classifierName - the name of given classifier
      selectedEvaluationClassifierPanel - panel of the selected classifier contained the parameter values
      kFolds - the number of equal sized subsamples that is used in k-fold cross validation
  • Method Details

    • setDataInfo

      public void setDataInfo(double[][] data, String[] nameFeatures, String[] classLabel)
      This method sets the information of the dataset.
      Parameters:
      data - the input dataset values
      nameFeatures - the string array of features names
      classLabel - the string array of class labels names
    • crossValidation

      public Criteria crossValidation(int[] selectedFeature)
      This method performs k-fold cross validation on the reduced training set which is achieved by selected feature subset.
      Parameters:
      selectedFeature - an array of indices of the selected feature subset
      Returns:
      the different criteria values
    • createTempDirectory

      public void createTempDirectory()
      This method creates a directory based on the specific path
    • deleteTempDirectory

      public void deleteTempDirectory()
      This method deletes the current directory with all files in the directory