Class Particle
java.lang.Object
unifeat.featureSelection.wrapper.PSOBasedMethods.BasicParticle<Double,Double>
unifeat.featureSelection.wrapper.PSOBasedMethods.CPSO.Particle
This java class is used to represent a particle in continuous particle swarm
optimization (CPSO) method in which the type of position and velocity vectors
are 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
-
Field Details
-
THETA
public static double THETA
-
-
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<Double,
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<Double,
Double> - Returns:
- the array of indices of the selected features by the particle
-