# Drzewa decyzyjne

EN: **Decision trees** · id `decisiontrees`

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Uczenie maszynowe](https://aiatlasgraph.com/t/ml.md) › [Drzewa i metody zespołowe](https://aiatlasgraph.com/t/ensembles.md) › Drzewa decyzyjne

## Description

- PL: Model zadający serię pytań o cechy (jeśli–to), aż dojdzie do odpowiedzi. Łatwy do odczytania, ale pojedynczy łatwo się przeucza; jest cegiełką lasów losowych i boostingu.
- EN: A model that asks a series of if–then questions about features until it reaches an answer. Easy to read but a single tree overfits easily; it is the building block of random forests and boosting.

## In one sentence

- PL: To modele dochodzące do odpowiedzi przez serię pytań o cechy przykładu.
- EN: These models reach an answer through a sequence of questions about an example's features.

## Problem it solves

- PL: Chcesz przewidywać odpowiedzi i móc prześledzić, które warunki doprowadziły do konkretnego wyniku.
- EN: You want predictions whose conditions you can follow to understand how a particular result was reached.

## What it does

- PL: Dzieli przykłady kolejnymi pytaniami, a na końcu każdej ścieżki przypisuje kategorię lub liczbę na podstawie danych do nauki.
- EN: It splits examples through successive questions and assigns a category or number at each path's end using the learning data.

## Everyday example

- PL: Model szacuje czas naprawy, pytając kolejno o rodzaj usterki, dostępność części i wiek urządzenia.
- EN: A model estimates repair time by asking about fault type, parts availability and equipment age in sequence.

## This concerns you if you…

- PL: chcesz widzieć kolejne warunki prowadzące do odpowiedzi
- PL: szukasz prostego modelu dla danych w tabeli
- EN: want to see the conditions leading to an answer
- EN: seek a simple model for tabular data

## Keywords

Gini impurity · information gain · cost-complexity pruning · tree depth · CART

## How it works

- PL: Algorytm wybiera podziały cech zmniejszające niejednorodność etykiet lub błąd w potomnych grupach. Rekurencyjne rozgałęzienia kończą się liśćmi zwracającymi klasę, rozkład lub wartość, z ograniczeniami głębokości i wielkości prób.
- EN: The algorithm selects feature splits reducing label impurity or error in child groups. Recursive branches end in leaves returning classes, distributions or values, constrained by depth and sample-size limits.

## Limits

- PL: Małe zmiany danych mogą zmienić strukturę drzewa. Głębokie podziały przeuczają się, a zachłanny dobór nie gwarantuje najlepszej struktury globalnie.
- EN: Small data changes can alter tree structure. Deep splits overfit, and greedy selection does not guarantee the globally best structure.

## Key terms

- PL: **niejednorodność**: Miara mieszania różnych etykiet w węźle drzewa.
- PL: **liść**: Końcowy węzeł przypisujący predykcję przykładom spełniającym warunki ścieżki.
- EN: **impurity**: A measure of label mixing within a tree node.
- EN: **leaf**: A terminal node predicting for examples satisfying its path conditions.

## Know first

- [Teoria informacji: entropia i dywergencja KL (Information theory: entropy, cross-entropy and KL divergence)](https://aiatlasgraph.com/t/infotheory.md)
- [Metryki klasyfikacji i regresji (Classification and regression metrics)](https://aiatlasgraph.com/t/classmetrics.md)

## Examples

- PL: podział wg Gini/entropii · przycinanie · głębokość drzewa
- EN: Gini/entropy splits · pruning · tree depth

## Sources

- [scikit-learn User Guide (version 1.9.1)](<https://scikit-learn.org/stable/user_guide.html>) `sklearn-user-guide` · by scikit-learn developers

---

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