evox.algorithms.so.pso_variants.fs_pso
¶
Module Contents¶
Classes¶
The Feature Selection PSO algorithm. |
API¶
- class evox.algorithms.so.pso_variants.fs_pso.FSPSO(pop_size: int, lb: torch.Tensor, ub: torch.Tensor, inertia_weight: float = 0.6, cognitive_coefficient: float = 2.5, social_coefficient: float = 0.8, mean=None, stdev=None, mutate_rate: float = 0.01, device: torch.device | None = None)[source]¶
Bases:
evox.core.Algorithm
The Feature Selection PSO algorithm.
Initialization
Initialize the FSPSO algorithm with the given parameters.
- Parameters:
pop_size – The size of the population.
lb – The lower bounds of the particle positions. Must be a 1D tensor.
ub – The upper bounds of the particle positions. Must be a 1D tensor.
inertia_weight – The inertia weight. Defaults to 0.6.
cognitive_coefficient – The cognitive weight. Defaults to 2.5.
social_coefficient – The social weight. Defaults to 0.8.
mean – The mean of the normal distribution. Defaults to None.
stdev – The standard deviation of the normal distribution. Defaults to None.
mutate_rate – The mutation rate. Defaults to 0.01.
device – The device to use for the tensors. Defaults to None.