RefiningInitializer#

class RefiningInitializer(initializer, estimator, *, fit_kwargs=None)[исходный код]#

Базовые классы: Initializer

Refines the start of another initializer with a mixture estimator.

The start of initializer goes to estimator.fit(X, start, **fit_kwargs). Only the nested initializer gets the generator.

fit_kwargs is a mapping checked against the signature of fit at creation, or a function of the families of the call whose result is checked on every initialize; for example, it can build the ECM parameter groups of any mixture. The values are not checked.

If the estimator returns fewer components than families (a pruner removed one), the run fails with InitializationError, so a multistart skips it.

Параметры:
  • initializer (Initializer) – The initializer that builds the starting mixture.

  • estimator (BaseEstimator) – The estimator that refines the start.

  • fit_kwargs (Mapping[str, Any] | Callable[[Sequence[ParametricFamily]], Mapping[str, Any]] | None, optional) – Keyword arguments of every fit call after the sample and the mixture, or a function that computes them from the families of each call.

Переменные:
  • initializer (Initializer) – The nested initializer, the same object that was passed to the constructor.

  • estimator (BaseEstimator) – The estimator, the same object that was passed to the constructor.

  • fit_kwargs (dict[str, Any] | Callable[[Sequence[ParametricFamily]], Mapping[str, Any]]) – A copy of the passed mapping; the values are shared. A passed function is stored as the same object.

Исключение:

TypeError – If a role has the wrong type, or fit_kwargs is not a mapping, a callable or None, or a mapping does not fit the signature of fit (the error of the signature is the __cause__).

Methods

initialize(X, families[, random_state])

Build a starting mixture from the sample.