MultiStartInitializer#

class MultiStartInitializer(initializer, n_init)[исходный код]#

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

Runs another initializer several times and returns the start with the largest log-likelihood.

Run i gets child i of rng.spawn(n_init): an integer seed reproduces the whole multistart, and numpy.random.default_rng(seed).spawn(i + 1)[i] reproduces one run. A passed generator advances only its counter of children, not its stream of numbers. Ties go to the earlier run.

A run that raises InitializationError is skipped. If some runs fail, a RuntimeWarning reports how many and the last reason; if all fail, InitializationError is raised with the last reason as its cause. Other exceptions pass through at once.

Параметры:
  • initializer (Initializer) – The initializer to repeat; its checks of the input and the result apply in every run.

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

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

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

Исключение:
  • TypeError – If initializer is not an Initializer.

  • ValueError – If n_init is not a positive integer.

Methods

initialize(X, families[, random_state])

Build a starting mixture from the sample.