# Przygotowanie cech (feature engineering)

EN: **Feature engineering and preprocessing** · id `featureeng`

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

## Description

- PL: Zamiana surowych kolumn w cechy, z których model potrafi się uczyć: skalowanie, kodowanie kategorii, uzupełnianie braków, tworzenie i wybór cech. Kroki spina się w pipeline, żeby nie przeciekały informacje ze zbioru testowego.
- EN: Turning raw columns into features a model can learn from: scaling, encoding categories, imputing missing values, creating and selecting features. Steps are chained in a pipeline so no test-set information leaks in.

## In one sentence

- PL: To przygotowanie danych w postaci, z której model może się uczyć.
- EN: This prepares data in a form a model can learn from.

## Problem it solves

- PL: Surowe tabele zawierają braki, różne skale i opisy, których model nie potrafi bezpośrednio wykorzystać.
- EN: Raw tables contain missing values, different scales and descriptions that a model cannot directly use.

## What it does

- PL: Uzupełnia braki według ustalonych zasad, przelicza wartości i zamienia opisy na użyteczne cechy, ucząc te przekształcenia bez podglądania danych testowych.
- EN: It handles missing values, rescales numbers and converts descriptions into useful features, learning those transformations without examining test data.

## Everyday example

- PL: Z tabeli zamówień tworzysz cechy takie jak czas od poprzedniego zakupu i pora dnia, żeby model mógł porównywać przypadki.
- EN: You turn an order table into features such as time since the previous purchase and time of day so a model can compare cases.

## This concerns you if you…

- PL: dane wymagają przygotowania przed użyciem w modelu
- PL: chcesz wybrać informacje przydatne do przewidywania
- EN: need to prepare data before using a model
- EN: want to select information useful for predictions

## Keywords

one-hot encoding · standardization · imputation · feature crosses · ColumnTransformer · Pipeline · categorical encoding

## How it works

- PL: Transformacje kodują kategorie, uzupełniają braki, skalują wartości i konstruują cechy z surowych danych. Parametry przygotowania dopasowuje się tylko na części treningowej, zapisując cały proces razem z modelem.
- EN: Transformations encode categories, impute missing values, scale measurements and construct features from raw data. Preparation parameters are fitted only on training data, with the entire process recorded alongside the model.

## Limits

- PL: Cecha użyteczna w treningu może nie być dostępna przy predykcji. Kodowanie i imputacja wprowadzają założenia; przygotowanie na całym zbiorze powoduje wyciek do oceny.
- EN: A feature useful during training may be unavailable at prediction time. Encoding and imputation introduce assumptions; fitting preparation on all data leaks into evaluation.

## Key terms

- PL: **imputacja**: Uzupełnianie brakujących wartości według ustalonej reguły lub modelu.
- PL: **kodowanie kategorii**: Przekład etykiet kategorii na reprezentację użyteczną dla modelu.
- EN: **imputation**: Filling missing values using a specified rule or model.
- EN: **categorical encoding**: Converting category labels into a representation usable by a model.

## Know first

- [Walidacja i testy danych (Data validation and testing)](https://aiatlasgraph.com/t/datavalidation.md)
- [Podziały i wyciek danych (Data splits and leakage)](https://aiatlasgraph.com/t/splits.md)

## Examples

- PL: one-hot · skalowanie · imputacja · feature crosses · pipeline
- EN: one-hot · scaling · imputation · feature crosses · pipeline

## Subtopics (4 direct, 4 in total)

- [Kodowanie zmiennych kategorycznych (Categorical feature encoding)](https://aiatlasgraph.com/t/categoricalencoding.md): Converting categorical features into numeric representations: one-hot, ordinal, target encoding or learned embeddings.
- [Selekcja cech (Feature selection)](https://aiatlasgraph.com/t/featureselection.md): Choosing a feature subset with filter methods (tests, mutual information), wrapper methods (RFE, sequential selection) and embedded methods (L1, feature importance).
- [Skalowanie i normalizacja cech (Feature scaling and normalisation)](https://aiatlasgraph.com/t/featurescaling.md): Transformations of numeric features: standardisation, min–max, robust scaling, and log, power and quantile transforms.
- [Uzupełnianie brakujących danych (imputacja) (Missing data imputation)](https://aiatlasgraph.com/t/missingimputation.md): Replacing missing entries with estimates from simple statistics, neighbours or a model of other features, often with an added missingness indicator.

## Related topics

Untyped, symmetric "see also" links.

- [Czyszczenie i jakość (Data cleaning and quality)](https://aiatlasgraph.com/t/cleaning.md)
- [Magazyn cech (feature store) (Feature store)](https://aiatlasgraph.com/t/featurestore.md)
- [Podziały i wyciek danych (Data splits and leakage)](https://aiatlasgraph.com/t/splits.md)
- [Rodzaje wycieku danych i ich wykrywanie (Types of data leakage and their detection)](https://aiatlasgraph.com/t/leakagetypes.md)

## 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
- [Google — Machine Learning Crash Course](<https://developers.google.com/machine-learning/crash-course>) `google-mlcc` · by Google for Developers

---

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