# Algorytm EM i modele mieszanin

EN: **Expectation-maximisation and mixture models** · id `emmixtures` · aliases: EM algorithm, expectation-maximization algorithm, expectation-maximisation algorithm, algorytm EM, mixture models, modele mieszanin

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Fundamenty i rozumowanie](https://aiatlasgraph.com/t/foundations.md) › [Modele probabilistyczne](https://aiatlasgraph.com/t/probabilistic.md) › Algorytm EM i modele mieszanin

## Description

- PL: Iteracyjna metoda szukania estymatorów największej wiarygodności w modelach ze zmiennymi ukrytymi, np. mieszaninach gaussowskich.
- EN: Iterative method for maximum-likelihood estimates in models with latent variables, such as Gaussian mixtures.

## In one sentence

- PL: Metoda dopasowania modelu, gdy część informacji jest ukryta, np. z której grupy pochodzi każdy punkt danych.
- EN: A method for fitting a model when part of the information is hidden, such as which group each data point came from.

## Problem it solves

- PL: Dane często mieszają kilka niewidocznych grup, a bez znajomości przynależności trudno opisać każdą z nich osobno.
- EN: Data often blends several invisible groups, and without knowing membership it is hard to describe each one separately.

## What it does

- PL: Na zmianę zgaduje przynależność punktów i poprawia opis grup na podstawie tych domysłów, aż obie rzeczy przestaną się zmieniać.
- EN: It alternates between guessing points' membership and improving the group descriptions from those guesses until both stop changing.

## Everyday example

- PL: Sklep internetowy dzieli klientów na kilka typów zakupowych, nie wiedząc z góry, kto do którego należy.
- EN: An online shop splits customers into several shopping types without knowing in advance who belongs where.

## This concerns you if you…

- PL: dzielisz dane na grupy z miękkim przypisaniem
- PL: masz dane z brakującymi wartościami
- EN: split data into groups with soft assignment
- EN: have data with missing values

## Keywords

Gaussian mixture model · E-step · M-step · latent variables · soft clustering · Baum-Welch · BIC model selection · scikit-learn GaussianMixture

## How it works

- PL: Krok E liczy rozkład zmiennych ukrytych przy bieżących parametrach, np. odpowiedzialność każdej składowej mieszaniny za punkt. Krok M maksymalizuje oczekiwaną log-wiarygodność względem parametrów, co daje proste wzory na średnie, kowariancje i wagi. Każda iteracja nie zmniejsza wiarygodności; metoda k-średnich jest jej twardym, granicznym przypadkiem.
- EN: The E-step computes the latent-variable distribution under current parameters, e.g. each mixture component's responsibility for a point. The M-step maximises expected log-likelihood over parameters, giving simple updates for means, covariances and weights. Each iteration never decreases likelihood; k-means is its hard-assignment limiting case.

## Limits

- PL: Zbiega do maksimum lokalnego, więc wynik zależy od inicjalizacji. Liczbę składowych trzeba wybrać osobno, a przy wielu wymiarach kowariancje bywają źle uwarunkowane.
- EN: It converges to a local maximum, so results depend on initialisation. The number of components must be chosen separately, and covariances can be ill-conditioned in high dimensions.

## Key terms

- PL: **zmienna ukryta**: Wielkość, której nie obserwujemy, ale która wpływa na dane.
- PL: **odpowiedzialność**: Prawdopodobieństwo, że dany punkt pochodzi z danej składowej.
- EN: **latent variable**: A quantity we do not observe that shapes the data.
- EN: **responsibility**: Probability that a point came from a given component.

## Know first

- [Estymacja parametrów (największa wiarygodność) (Parameter estimation (maximum likelihood, MAP))](https://aiatlasgraph.com/t/mle.md)
- [Klasteryzacja (Clustering)](https://aiatlasgraph.com/t/clustering.md)

## Related topics

Untyped, symmetric "see also" links.

- [Metoda k-średnich (k-means) (k-means clustering)](https://aiatlasgraph.com/t/kmeans.md)

## Sources

- [Deisenroth, Faisal, Ong · Mathematics for Machine Learning — table of contents](<https://mml-book.github.io/>) `mmlbook` · by Marc Peter Deisenroth, A. Aldo Faisal, Cheng Soon Ong

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/emmixtures · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
