# Skalowanie i normalizacja cech

EN: **Feature scaling and normalisation** · id `featurescaling` · aliases: feature scaling, normalizacja cech, skalowanie cech

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Uczenie maszynowe](https://aiatlasgraph.com/t/ml.md) › [Przygotowanie cech (feature engineering)](https://aiatlasgraph.com/t/featureeng.md) › Skalowanie i normalizacja cech

## Description

- PL: Przekształcenia cech liczbowych: standaryzacja, min–max, skalowanie odporne oraz transformacje logarytmiczne, potęgowe i kwantylowe.
- EN: Transformations of numeric features: standardisation, min–max, robust scaling, and log, power and quantile transforms.

## In one sentence

- PL: Sprowadzanie liczb z różnych kolumn do podobnej skali, żeby żadna nie dominowała tylko przez swoje jednostki.
- EN: Bringing numbers from different columns to a similar range so none dominates just because of its units.

## Problem it solves

- PL: Wiek liczony w latach i wydatki w złotówkach dają liczby różnych rzędów, przez co część modeli źle je porównuje.
- EN: Age in years and spending in currency produce numbers of very different sizes, so some models compare them badly.

## What it does

- PL: Przelicza każdą kolumnę jak walutę na wspólną miarę: odejmuje typową wartość i dzieli przez typowy rozrzut.
- EN: It converts each column like a currency into a common measure: subtract the typical value, divide by the typical spread.

## Everyday example

- PL: Szukając podobnych klientów, wyrównujesz skalę wieku i wydatków, żeby odległość nie zależała tylko od kwot.
- EN: When looking for similar customers, you put age and spending on the same scale so distance doesn't depend only on amounts.

## This concerns you if you…

- PL: twoje kolumny mają bardzo różne jednostki
- PL: używasz modeli opartych na odległościach lub gradientach
- EN: your columns use very different units
- EN: use models based on distances or gradients

## Keywords

StandardScaler · MinMaxScaler · RobustScaler · QuantileTransformer · PowerTransformer · Yeo-Johnson · log transform · z-score

## How it works

- PL: Standaryzacja odejmuje średnią i dzieli przez odchylenie standardowe; min–max mapuje wartości na przedział [0, 1]; skalowanie odporne używa mediany i rozstępu międzykwartylowego. Transformacje logarytmiczne, potęgowe i kwantylowe zmieniają kształt rozkładu. Parametry wylicza się tylko na zbiorze treningowym.
- EN: Standardisation subtracts the mean and divides by the standard deviation; min–max maps values to [0, 1]; robust scaling uses the median and interquartile range. Log, power and quantile transforms reshape the distribution. Parameters are computed on training data only.

## Limits

- PL: Modele drzewiaste zwykle nie potrzebują skalowania. Min–max jest wrażliwe na wartości odstające. Dopasowanie skalera na całym zbiorze przecieka informacją ze zbioru testowego.
- EN: Tree-based models usually don't need scaling. Min–max is sensitive to outliers. Fitting the scaler on the full dataset leaks test-set information.

## Key terms

- PL: **standaryzacja (z-score)**: Pokazuje, o ile odchyleń standardowych wartość odbiega od średniej.
- PL: **skalowanie odporne**: Użycie mediany i kwartyli, mniej wrażliwe na skrajne wartości.
- EN: **standardisation (z-score)**: Shows how many standard deviations a value lies from the mean.
- EN: **robust scaling**: Uses the median and quartiles, less sensitive to extreme values.

## Sources

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

---

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