Approximate Lazy Greedy

The approximate lazy/accelerated greedy algorithm for optimization.

The approximate lazy greedy algorithm is a simple extension of the lazy greedy algorithm that, rather than requiring that an element remains at the top of the priority queue after being re-evaluated, only requires that the gain is within a certain user-defined percentage of the best gain to be selected. The key point in this approach is that finding the very best element while maintaining the priority queue may be expensive, but finding elements that are good enough is simple. While the best percentage to use is data set specific, even values near 1 can lead to large savings in computation.

param self.function:
 A submodular function that implements the _calculate_gains and _select_next methods. This is the function that will be optimized.
type self.function:
 base.BaseSelection
param self.verbose:
 Whether to display a progress bar during the optimization process.
type self.verbose:
 bool
self.function

A submodular function that implements the _calculate_gains and _select_next methods. This is the function that will be optimized.

Type:base.BaseSelection
self.verbose

Whether to display a progress bar during the optimization process.

Type:bool
self.pq

The priority queue used to order examples for evaluation.

Type:utils.PriorityQueue
self.gains_

The gain that each example would give the last time that it was evaluated.

Type:numpy.ndarray or None