CauchyMixture

noloox.mixture.CauchyMixture

Bases: StudentsTMixture

Cauchy Mixture Model. This class allows you to estimate a multivariate mixture of Cauchys over your data. Equivalent to StudentsTMixture, except the degrees of freedom is fixed to 1.

Parameters:

Name Type Description Default
n_components int

The number of mixture components.

required
tol float

The convergence threshold. EM iterations will stop when the lower bound average gain is below this threshold.

1e-05
reg_covar float

Non-negative regularization added to the diagonal of covariance. Allows to assure that the covariance matrices are all positive.

1e-06
max_iter int

The number of EM iterations to perform.

1000

Attributes:

Name Type Description
weights_ array-like of shape (n_components,)

The weights of each mixture components.

means_ array-like of shape (n_components, n_features)

The mean of each mixture component.

n_iter_ int

Number of step used by the best fit of EM to reach the convergence.

converged_ bool

True when convergence of the best fit of EM was reached, False otherwise.

Source code in noloox/mixture/tmm.py
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
class CauchyMixture(StudentsTMixture):
    """Cauchy Mixture Model.
    This class allows you to estimate a multivariate mixture of Cauchys over your data.
    Equivalent to StudentsTMixture, except the degrees of freedom is fixed to 1.

    Parameters
    ----------
    n_components: int
        The number of mixture components.
    tol: float, default=1e-5
        The convergence threshold. EM iterations will stop when the lower bound average gain is below this threshold.
    reg_covar: float, default=1e-6
        Non-negative regularization added to the diagonal of covariance. Allows to assure that the covariance matrices are all positive.
    max_iter: int, default=1000
        The number of EM iterations to perform.

    Attributes
    ----------
    weights_: array-like of shape (n_components,)
        The weights of each mixture components.
    means_: array-like of shape (n_components, n_features)
        The mean of each mixture component.
    n_iter_: int
        Number of step used by the best fit of EM to reach the convergence.
    converged_: bool
        True when convergence of the best fit of EM was reached, False otherwise.
    """

    def __init__(
        self,
        n_components: int,
        tol: float = 1e-5,
        reg_covar: float = 1e-06,
        max_iter: int = 1000,
        random_state=None,
    ):
        super().__init__(
            n_components=n_components,
            tol=tol,
            reg_covar=reg_covar,
            max_iter=max_iter,
            random_state=random_state,
            df=1.0,
        )