Class Particle
java.lang.Object
unifeat.featureSelection.wrapper.PSOBasedMethods.BasicParticle<Boolean,Double>
unifeat.featureSelection.wrapper.PSOBasedMethods.BPSO.Particle
This java class is used to represent a particle in binary particle swarm
optimization (BPSO) method in which the type of position vector is boolean
and the type of velocity vector is double.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Fields inherited from class unifeat.featureSelection.wrapper.PSOBasedMethods.BasicParticle
pBest, position, velocity
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
This method returns the number of selected features by the particle based on position vector.int[]
This method returns the indices of selected features by the particle based on position vector.Methods inherited from class unifeat.featureSelection.wrapper.PSOBasedMethods.BasicParticle
getFitness, getPBestFitness, setFitness, setPBestFitness
-
Constructor Details
-
Particle
public Particle(int dimension) Initializes the parameters- Parameters:
dimension
- the dimension of problem which equals to total number of features in the dataset
-
-
Method Details
-
numSelectedFeatures
public int numSelectedFeatures()This method returns the number of selected features by the particle based on position vector.- Specified by:
numSelectedFeatures
in classBasicParticle<Boolean,
Double> - Returns:
- number of selected features by the particle
-
selectedFeaturesSubset
public int[] selectedFeaturesSubset()This method returns the indices of selected features by the particle based on position vector.- Specified by:
selectedFeaturesSubset
in classBasicParticle<Boolean,
Double> - Returns:
- the array of indices of the selected features by the particle
-