Class BasicPSO<SwarmType>

java.lang.Object
unifeat.featureSelection.FeatureSelection
unifeat.featureSelection.wrapper.WrapperApproach
unifeat.featureSelection.wrapper.PSOBasedMethods.BasicPSO<SwarmType>
Type Parameters:
SwarmType - the type of swarm implemented in PSO algorithm
Direct Known Subclasses:
BPSO, CPSO, HPSO_LS, PSO42

public abstract class BasicPSO<SwarmType> extends WrapperApproach
The abstract class contains the main methods and fields that are used in all PSO-based feature selection methods.
Author:
Sina Tabakhi
See Also:
  • Field Details

    • swarm

      protected SwarmType swarm
    • NUM_ITERATION

      protected final int NUM_ITERATION
    • K_FOLDS

      protected final int K_FOLDS
  • Constructor Details

    • BasicPSO

      public BasicPSO(Object... arguments)
      Initializes the parameters
      Parameters:
      arguments - array of parameters contains ( path, numFeatures, classifierType, selectedClassifierPan, numIteration populationSize, inertiaWeight, parameter c1, parameter c2, startPosInterval, endPosInterval, minVelocity, maxVelocity, kFolds) in which path is the path of the project, numFeatures is the number of original features in the dataset, classifierType is the classifier type for evaluating the fitness of a solution, selectedClassifierPan is the selected classifier panel, numIteration is the maximum number of allowed iterations that algorithm repeated, populationSize is the size of population of candidate solutions, inertiaWeight is the inertia weight in the velocity updating rule, parameter c1 is the acceleration constant in the velocity updating rule, parameter c2 is the acceleration constant in the velocity updating rule, startPosInterval is the position interval start value, endPosInterval is the position interval end value, minVelocity is the velocity interval start value, maxVelocity is the velocity interval end value, and kFolds is the number of equal sized subsamples that is used in k-fold cross validation
  • Method Details

    • createSelectedFeatureSubset

      protected abstract int[] createSelectedFeatureSubset()
      This method creates the selected feature subset based on global best position in the swarm.
      Returns:
      the array of indices of the selected feature subset
    • validate

      public String validate()
      This method returns the potential errors in the input parameters.
      Overrides:
      validate in class FeatureSelection
      Returns:
      a string contains the information about incorrect parameters