MultiStartRefiningInitializer#

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

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

Runs several starts refined by an estimator and returns the refinement with the largest log-likelihood.

Each of the n_init runs builds its start with the nested initializer and refines it with a short run of the estimator; the result is the run with the largest log-likelihood after the refinement. This is the emEM scheme with a short EM: the length of the run is controlled by the breakpointers of the estimator.

The facade is equivalent to MultiStartInitializer(RefiningInitializer(initializer, estimator, fit_kwargs=fit_kwargs), n_init). Note the difference from the reverse nesting RefiningInitializer(MultiStartInitializer(...), estimator), where only the best start is refined.

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

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

  • n_init (int | numpy.integer) – The positive number of independent runs.

  • 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 (read-only).

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

  • n_init (int) – The number of runs as int (read-only).

  • 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 (read-only).

Исключение:
  • 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__).

  • ValueError – If n_init is not a positive integer.

Methods

initialize(X, families[, random_state])

Build a starting mixture from the sample.