API - hyperparameter optimization routines#

class found.tune.Tuner[source]#

abstract base class for a hyper parameter tuner which wraps some pipeline

class found.tune.NaiveMaxScoreTuner(score_fn, k_range)[source]#

tuner class which attempts to select for an optimal k by selecting the k with maximal score as calculated by self.score_fn for each provided k in self.k_range

assumes that provided pipeline takes an argument k at invocation which dictates the number of dimensions to calculate in the reduction

Parameters:
  • score_fn (Callable[..., int | float | floating | integer]) – function which given some arguments is able to determine a “score” for the pipeline results

  • k_range (Iterable[int]) – iterable collection of dimensions over which pipeline should be run to determine optimal k

class found.tune.FixPointTuner(min_stable, start_k, pct_delta, force_dec=False)[source]#

tuner class which attempts to select for an optimal k (k_opt) > self.start_k such that where:

  • v_hat(x, k): is the adjusted label for a cell x under dimensionality reduction of dimension k

  • n_change(k): is # of cells x for which it is true that v_hat(x, k) != v_hat(x, k-1)

for all k in (k_opt-self.min_stable, k_opt]: n_change(k) < # of cells * self.pct_delta (e.g. first dimension g.t. self.start_k such that for previous self.min_stable dimensions, labels haven’t changed by more than self.pct_delta percent)

if self.force_dec is True, we also enforce the property that: for all k in (k_opt-self.min_stable, k_opt]: n_change(k) <= n_change(k-1) (e.g. number of changing labels was decreasing for all self.min_stable k prior to selected optimal k)

assumes that provided pipeline takes an argument k at invocation which dictates the number of dimensions to calculate in the reduction

Parameters:
  • min_stable (int) – number of dimensions for which stability property outlined above must hold

  • start_k (int) – number of dimensions to start iteration process with

  • pct_delta (float) – percent change in label considered allowable

  • force_dec (bool) – whether to also enforce decreasing property outlined above, defaults to False