RefiningInitializer#
- class RefiningInitializer(initializer, estimator, *, fit_kwargs=None)[исходный код]#
Базовые классы:
InitializerRefines the start of another initializer with a mixture estimator.
The start of
initializergoes toestimator.fit(X, start, **fit_kwargs). Only the nested initializer gets the generator.fit_kwargsis a mapping checked against the signature offitat creation, or a function of the families of the call whose result is checked on everyinitialize; 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
fitcall 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_kwargsis not a mapping, a callable or None, or a mapping does not fit the signature offit(the error of the signature is the__cause__).
Methods
initialize(X, families[, random_state])Build a starting mixture from the sample.