with_component#

MixtureModel.with_component(index, component)[исходный код]#

Return a new mixture with the component at index replaced.

The log-weights are unchanged and shared with this mixture.

Параметры:
  • index (int) – Index of the component to replace; negative indices are not supported.

  • component (ParametricFamilyDistribution) – The replacement component.

Результат:

A new mixture; this mixture is left unchanged.

Тип результата:

MixtureModel

Исключение:

IndexError – If index is outside [0, n_components - 1].