# Uczenie maszynowe dla czasu do zdarzenia

EN: **Machine learning for time-to-event outcomes** · id `survivalanalysis` · aliases: time-to-event analysis, survival models, Cox model, DeepSurv, analiza czasu do zdarzenia, analiza przeżycia

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [AI w medycynie i ochronie zdrowia](https://aiatlasgraph.com/t/healthai.md) › [Prognozowanie ryzyka z dokumentacji pacjenta](https://aiatlasgraph.com/t/clinicalprediction.md) › Uczenie maszynowe dla czasu do zdarzenia

## Description

- PL: Modele przewidujące czas do zdarzenia przy danych cenzurowanych, od modelu Coxa po lasy przeżycia i sieci neuronowe.
- EN: Models predicting time to an event with censored data, from the Cox model to survival forests and neural networks.

## In one sentence

- PL: Metody, które przewidują nie tylko, czy coś złego się wydarzy, ale też kiedy, nawet gdy części pacjentów nie obserwowano do końca.
- EN: Methods that predict not just whether something bad will happen but when, even if some patients were not followed to the end.

## Problem it solves

- PL: Badania kończą się, zanim u wszystkich nastąpi zdarzenie, a zwykłe modele nie wiedzą, co zrobić z osobami, które wypadły z obserwacji.
- EN: Studies end before everyone has the event, and ordinary models don't know what to do with people who dropped out of follow-up.

## What it does

- PL: Jak tablica, ilu biegaczy wciąż jest na trasie po każdym kilometrze, która uczciwie liczy też tych, których straciliśmy z oczu.
- EN: Like a board showing how many runners are still in the race after each kilometre, fairly counting those we lost sight of.

## Everyday example

- PL: Lekarz pokazuje pacjentowi wykres, ile osób po danej terapii żyje bez nawrotu po roku, dwóch i pięciu latach.
- EN: A doctor shows a patient a chart of how many people live without relapse one, two and five years after a treatment.

## This concerns you if you…

- PL: słyszysz o odsetku pięcioletnich przeżyć po leczeniu
- PL: przewidujesz czas do odejścia klienta lub awarii
- EN: hear about five-year survival rates after treatment
- EN: predict time until a customer leaves or a machine fails

## Keywords

Kaplan-Meier · Cox proportional hazards · DeepSurv · random survival forest · C-index · scikit-survival · lifelines · competing risks

## How it works

- PL: Obserwujemy krótszy z dwóch czasów: do zdarzenia albo do cenzurowania. Estymator Kaplana–Meiera nieparametrycznie szacuje funkcję przeżycia S(t); model proporcjonalnych hazardów Coxa wiąże cechy z logarytmem hazardu. Wersje uczenia maszynowego to lasy przeżycia i sieci (DeepSurv), a jakość mierzy m.in. indeks zgodności (C-index).
- EN: We observe the shorter of two times: to the event or to censoring. The Kaplan–Meier estimator non-parametrically estimates the survival function S(t); the Cox proportional-hazards model links features to the log hazard. ML versions include survival forests and networks (DeepSurv), and quality is measured e.g. by the concordance index (C-index).

## Limits

- PL: Model Coxa zakłada proporcjonalne hazardy, co często nie jest spełnione. Cenzurowanie związane z rokowaniem, np. odejście najciężej chorych, zniekształca wyniki. C-index ocenia tylko kolejność ryzyk, nie kalibrację, a ryzyka konkurencyjne wymagają osobnych metod.
- EN: The Cox model assumes proportional hazards, which often fails. Censoring tied to prognosis, such as the sickest dropping out, distorts results. The C-index judges only risk ordering, not calibration, and competing risks need separate methods.

## Key terms

- PL: **cenzurowanie**: Obserwacja urwana przed zdarzeniem; wiemy tylko, że do tej pory go nie było.
- PL: **funkcja hazardu**: Chwilowe ryzyko zdarzenia, jeśli dotąd nie wystąpiło.
- PL: **C-index**: Jak często model dobrze układa pacjentów według kolejności zdarzeń.
- EN: **censoring**: Follow-up cut off before the event; we only know it hasn't happened yet.
- EN: **hazard function**: The instantaneous event risk, given it hasn't happened so far.
- EN: **C-index**: How often the model ranks patients correctly by event order.

## Know first

- [Regresja liniowa i logistyczna (Linear and logistic regression)](https://aiatlasgraph.com/t/linearmodels.md)
- [Estymacja parametrów (największa wiarygodność) (Parameter estimation (maximum likelihood, MAP))](https://aiatlasgraph.com/t/mle.md)

## Related topics

Untyped, symmetric "see also" links.

- [Szacowanie, komu leczenie pomoże (efekt indywidualny) (Individualised treatment effect estimation)](https://aiatlasgraph.com/t/treatmenteffects.md)
- [Wczesne ostrzeganie o pogorszeniu stanu (np. sepsa) (Early warning systems for clinical deterioration (e.g. sepsis))](https://aiatlasgraph.com/t/earlywarning.md)

## Sources

- [DeepSurv: Personalized Treatment Recommender System Using A Cox Proportional Hazards Deep Neural Network](<https://arxiv.org/abs/1606.00931>) `deepsurv-2016` · by Jared Katzman, Uri Shaham, Jonathan Bates, Alexander Cloninger, Tingting Jiang, Yuval Kluger
- [scikit-survival User Guide: Introduction to Survival Analysis](<https://scikit-survival.readthedocs.io/en/stable/user_guide/00-introduction.html>) `sksurv-intro` · by Sebastian Pölsterl (scikit-survival)

---

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