opytimizer.optimizers.population.ppa

Parasitism-Predation Algorithm.

class opytimizer.optimizers.population.ppa.PPA(params: Optional[Dict[str, Any]] = None)

A PPA class, inherited from Optimizer.

This is the designed class to define PPA-related variables and methods.

References

A. Mohamed et al. Parasitism – Predation algorithm (PPA): A novel approach for feature selection. Ain Shams Engineering Journal (2020).

__init__(params: Optional[Dict[str, Any]] = None) → None

Initialization method.

Parameters:params – Contains key-value parameters to the meta-heuristics.
velocity

Array of velocities.

compile(space: opytimizer.core.space.Space) → None

Compiles additional information that is used by this optimizer.

Parameters:space – A Space object containing meta-information.
_calculate_population(n_agents: int, iteration: int, n_iterations: int) → Tuple[int, int, int]

Calculates the number of crows, cats and cuckoos.

Parameters:
  • n_agents – Number of agents.
  • iteration – Current iteration.
  • n_iterations – Maximum number of iterations.
Returns:

The number of crows, cats and cuckoos.

Return type:

(Tuple[int, int, int])

_nesting_phase(space: opytimizer.core.space.Space, n_crows: int)

Performs the nesting phase using the current number of crows.

Parameters:
  • space – Space containing agents and update-related information.
  • n_crows – Number of crows.
_parasitism_phase(space: opytimizer.core.space.Space, n_crows: int, n_cuckoos: int, iteration: int, n_iterations: int)

Performs the parasitism phase using the current number of cuckoos.

Parameters:
  • space – Space containing agents and update-related information.
  • n_crows – Number of crows.
  • n_cuckoos – Number of cuckoos.
  • iteration – Current iteration.
  • n_iterations – Maximum number of iterations.
_predation_phase(space: opytimizer.core.space.Space, n_crows: int, n_cuckoos: int, n_cats: int, iteration: int, n_iterations: int) → None

Performs the predation phase using the current number of cats.

Parameters:
  • space – Space containing agents and update-related information.
  • n_crows – Number of crows.
  • n_cuckoos – Number of cuckoos.
  • n_cats – Number of cats.
  • iteration – Current iteration.
  • n_iterations – Maximum number of iterations.
update(space: opytimizer.core.space.Space, iteration: int, n_iterations: int) → None

Wraps Parasitism-Predation Algorithm over all agents and variables.

Parameters:
  • space – Space containing agents and update-related information.
  • iteration – Current iteration.
  • n_iterations – Maximum number of iterations.