# Sample Greedy¶

The sample greedy algorithm for optimization.

The sample greedy algorithm is a simple approach that subsamples the full data set with a user-defined sampling probability and then runs an optimization on that subset. This subsampling can lead to obvious speed improvements because fewer elements as selected, but will generally find a lower quality subset because fewer elements are present. This approach is typically used a baseline for other approaches but can save a lot of time on massive data sets that are known to be highly redundant.

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 epsilon:The sampling probability to use when constructing the subset. A subset of size n * epsilon will be selected from.
type epsilon:float, optional
param random_state:
The random seed to use for the random selection process.
type random_state:
int or RandomState or None, optional
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.gains_

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

Type: numpy.ndarray or None